{"id":54,"date":"2022-08-22T19:29:40","date_gmt":"2022-08-22T19:29:40","guid":{"rendered":"https:\/\/ideaes.xhere.eu.org\/?p=54"},"modified":"2022-08-22T19:36:19","modified_gmt":"2022-08-22T19:36:19","slug":"go-day1","status":"publish","type":"post","link":"https:\/\/ideaes.xhere.eu.org\/?p=54","title":{"rendered":"Go day1"},"content":{"rendered":"\n<p>Go is an strong and statically typed. It has an excellent community. golangbridge.org is a good example<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Key features<\/h3>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>Simplicity<\/li><li>Fast compile times<\/li><li>Garbage collection<\/li><li>Concurrency<\/li><li>Stand alone binaries<\/li><\/ul>\n<\/div><\/div>\n\n\n\n<p>Go is focus on server side and not on clients<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Variable Topics<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Variable declaration<\/li><li>Redeclaration and shadowing<\/li><li>Visibility<\/li><li>Naming conventions<\/li><li>Type conversions<\/li><\/ul>\n\n\n\n<p>Three different ways to declare a variable:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var foo int \/\/ Use when the value is not known at the moment\nvar foo int = 42 \/\/ Use when the compiler might get it wrong\nfoo := 42 \/\/ Most use. Works inside a block not at the package level<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><br>Three level of visibility for a variable<\/p>\n\n\n\n<p>Package level with lower case<\/p>\n\n\n\n<p>Global with capitalize<\/p>\n\n\n\n<p>Variable at block lowercase<\/p>\n\n\n\n<p><br>Single letter for short lived variables<\/p>\n\n\n\n<p>Lower names for long lived variables using camelCase<\/p>\n\n\n\n<p>To convert to string using <code>strconv<\/code> function<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>var foo int<\/li><li>var foo int = 423<\/li><li>foo := 42<\/li><\/ul>\n\n\n\n<p>Normally the third version is used. The second version is used when the compiler is going to guess it wrong. The first version is used when the value is not known right away<br>Can&#8217;t redeclare variables, but can shadow them. All variables must be used<\/p>\n\n\n\n<p><br>Visibility<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>lower case first letter for package scope. <\/li><li>upper case first letter to export. <\/li><li>no private scope<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>Naming conventions<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> Pascal or camelCase<ul><li> &#8211; Capitalize Acronyns(HTTP, URL).<\/li><\/ul><\/li><li> As short as reasonable<ul><li> &#8211; longer names for longer lives<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>Type conversions<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> destination Type(variable).<\/li><li> use <code>strconv<\/code> package for strings<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go is an strong and statically typed. It has an excellent community. golangbridge.org is a good example Key features Simplicity Fast compile times Garbage collection Concurrency Stand alone binaries Go is focus on server side and not on clients Variable Topics Variable declaration Redeclaration and shadowing Visibility Naming conventions Type conversions Three different ways to &#8230;.&nbsp;&nbsp;<a class=\" default\" href=\"https:\/\/ideaes.xhere.eu.org\/?p=54\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[12],"tags":[13],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-golang","tag-golang"],"_links":{"self":[{"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":4,"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ideaes.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}