<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Inanc Gumus</title>
    <description>The latest articles on Forem by Inanc Gumus (@inancx).</description>
    <link>https://forem.com/inancx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F23493%2F2ff5cda1-6a27-4ca8-9eec-bcd30e6a1964.png</url>
      <title>Forem: Inanc Gumus</title>
      <link>https://forem.com/inancx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/inancx"/>
    <language>en</language>
    <item>
      <title>5 More Gotchas and Tricks of Defer in Go — Part III</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 18 Jan 2018 22:21:29 +0000</pubDate>
      <link>https://forem.com/inancx/5-more-gotchas-and-tricks-of-defer-in-gopart-iii-1fhb</link>
      <guid>https://forem.com/inancx/5-more-gotchas-and-tricks-of-defer-in-gopart-iii-1fhb</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-iii-36a1ab3d6ef1" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmz9t9wzmdp2s20922trf.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Calling recover outside of a deferred func&lt;/li&gt;
&lt;li&gt;Calling defer in the wrong order&lt;/li&gt;
&lt;li&gt;Not checking for errors&lt;/li&gt;
&lt;li&gt;Releasing the same resource twice&lt;/li&gt;
&lt;li&gt;panic/recover can get and return any type&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;👉 &lt;a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-iii-36a1ab3d6ef1" rel="noopener noreferrer"&gt;Press here to read the new article&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See you in two weeks!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com" rel="noopener noreferrer"&gt;Learn Go Programming&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 I’m tweeting tips and tricks about Go almost daily, &lt;a href="https://twitter.com/inancgumus" rel="noopener noreferrer"&gt;follow me on twitter&lt;/a&gt; and get them.&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Learn Go Programming - Yearly Recap - 2017</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 04 Jan 2018 19:14:45 +0000</pubDate>
      <link>https://forem.com/inancx/learn-go-programming---yearly-recap---2017-162e</link>
      <guid>https://forem.com/inancx/learn-go-programming---yearly-recap---2017-162e</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oUIe2Srj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ylkgrntoiy9ojqy7fgc2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/2017-yearly-recap-5349f6d7d67b"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P7dBFCHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7ehr3mgxgy0lizsqwf8g.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;In this article I’m going to cover what happened in 2017 and what will happen in 2018. And also, I’ve created a path for you to follow, so you can read my articles in order to digest them easily.&lt;/p&gt;




&lt;h1&gt;
  
  
  2017
&lt;/h1&gt;

&lt;p&gt;After working days, nights, weeks, weekends, and months fulltime educating people about Go for 3 months, this happened:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I wrote &lt;strong&gt;100,000 words&lt;/strong&gt; in total (&lt;em&gt;After edits: 20,000 words in total&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2.500+ unique people&lt;/strong&gt; followed me&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1.300+ people&lt;/strong&gt; followed my blog&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;500+ people&lt;/strong&gt; subscribed to my e-mail list (&lt;a href="http://eepurl.com/c4DMNX"&gt;Join here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;800+ people&lt;/strong&gt; followed &lt;a href="https://medium.com/@inanc"&gt;me on Medium&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;500+ people&lt;/strong&gt; followed &lt;a href="https://twitter.com/inancgumus"&gt;me on Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100+ subscribers in 10 days&lt;/strong&gt; to the newly created &lt;strong&gt;Learn Go Programming public Slack channel&lt;/strong&gt; (&lt;a href="https://join.slack.com/t/learngoprogramming/shared_invite/enQtMjkwNTEyMzM2MDY1LTdlZTc0YWYwZGI2MGY3ODc5NjQ5MjNhYWM2OGI2N2E4NTlmOGMwOTQ4YmVmNGZkMmUxZmYxZGQ0Nzg1ZGVmYzI"&gt;Join here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;I created &lt;strong&gt;dozens of visuals, animations and code exercises&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;I post &lt;strong&gt;hundreds of educational tweets&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Some of my posts become &lt;strong&gt;Reddit and &lt;a href="https://news.ycombinator.com/item?id=15979751"&gt;Hackernews&lt;/a&gt; top-posts&lt;/strong&gt; and shared by many other publications&lt;/li&gt;
&lt;li&gt;Many great people have reached and offered great &lt;strong&gt;opportunities&lt;/strong&gt; for me (&lt;em&gt;&lt;strong&gt;even joining to Google!&lt;/strong&gt;&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Dozens of people have said to me that they learned Go through my work&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  2018 Goals
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Some of my 2018 goals are about earning a little bit of money (somehow?) because I need to drink coffee too.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;“ Any suggestions? Please tell me. ”&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Releasing my &lt;strong&gt;online course&lt;/strong&gt; (&lt;em&gt;Started doing it — exciting!&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Releasing &lt;strong&gt;screencasts&lt;/strong&gt; which I’d talk about everything Go&lt;/li&gt;
&lt;li&gt;Creating a &lt;strong&gt;Youtube channel&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Writing a &lt;strong&gt;book&lt;/strong&gt; about Go&lt;/li&gt;
&lt;li&gt;Continue creating more &lt;strong&gt;awesome free content&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  👶 My Blog is Very Young
&lt;/h1&gt;

&lt;p&gt;It’s just ~3 months old — &lt;em&gt;I started doing it publicly since the last quarter of 2017&lt;/em&gt;. It has always been my goal to teach people what I know and I’m glad that I’m doing it now.&lt;/p&gt;




&lt;h1&gt;
  
  
  🤩 My Vision
&lt;/h1&gt;

&lt;p&gt;My vision has always been to create the most concise, information-packed, visual and simple to digest articles that you can find in one place.&lt;/p&gt;

&lt;p&gt;I’ve created this blog because the information about Go is dispersed in many places, so, you need to search for it in too many places. Also, many articles are too complex or just shallow or hard to understand for many beginners and even for intermediate-level gophers. I’m trying to reduce these problems.&lt;/p&gt;




&lt;p&gt;❤️ 💜 💙 💚 💛&lt;br&gt;
Allright! Now, I’m going to summarize most of the content I’ve created about Go last year. I’m very happy that I could be able to help people. &lt;strong&gt;Enjoy!&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  All articles from 2017
&lt;/h1&gt;

&lt;p&gt;You may read the articles in the order I‘m listing here. Almost all of my articles include explanations, tips and tricks, visuals and code exercises which you can try online.&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/about-go-language-an-overview-f0bee143597c"&gt;About Go Language — An Overview&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Go ecosystem and the language’s overview.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Packages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/definitive-guide-to-go-packages-focus-on-the-fundamentals-to-empower-your-skills-d14aae7cd321"&gt;Introduction to Go Packages&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;What is a package?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/using-packages-eb70cb61a16a"&gt;How to use packages&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;How to use your own, others’ and Go standard library’s packages?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/special-packages-and-directories-in-go-1d6295690a6b"&gt;Special Packages and Directories&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;About internal, main, library and vendor directories.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/code-organization-tips-with-packages-d30de0d11f46"&gt;Organize your code with packages&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;How to design a Go program with packages.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/packages-can-allow-or-disallow-for-reusability-2edb6bd18815"&gt;How to decouple your packages&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;How to increase code maintainability with packages.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/go-packages-summary-6d40ba46a6f4"&gt;Go Packages Rulebook&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Summarizing the rules for reference.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/what-are-goroot-and-gopath-1231b084723f"&gt;Fix your $GOPATH and $GOROOT&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;How to configure them and what they do.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/learn-go-lang-variables-visual-tutorial-and-ebook-9a061d29babe"&gt;Visual guide to Go Variables&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Introduction to variables and declaration styles.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-short-variable-declaration-rules-6df88c881ee"&gt;Short-variable declarations rulebook&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Tips and tricks about how to use short-variables. Intermediate-level.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Constants&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61"&gt;Visual guide to Go Constants&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Introduction to untyped and typed constants.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3"&gt;Ultimate Visual Guide to Go Enums&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;How to define an enum in Go and how to use iota?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-funcs-params-named-result-values-types-pass-by-value-67f4374d9c0a"&gt;Funcs — Baby-Gopher’s Visual Guide&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Introducing Go functions with examples.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/go-functions-overview-anonymous-closures-higher-order-deferred-concurrent-6799008dde7b"&gt;The Zoo of Go Functions&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Introductory tour of anonymous, higher-order, closure, concurrent, deferred, variadic funcs and methods.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085"&gt;Ultimate Guide to Go Variadic Funcs&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;A variadic func accepts variable number of input values — zero or more. The article covers everything about variadic funcs.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-defer-simplified-77d3b2b817ff"&gt;Defer Simplified with Practical Visuals&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Introduction to deferred functions. Includes deferred funcs, multiple defers, deferred methods, deferred closures, and other examples.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/yeah-semantically-after-is-the-right-word-fad1d5181891"&gt;Defer Internals — Quick Look&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;An intermediate-level article. Asking the question: Are defers run after or before the func returns?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa"&gt;5 Gotchas of Defer in Go (Golang) — Part II&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Beginner-level article which covers some basic pitfalls of deferred funcs.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01"&gt;5 Gotchas of Defer in Go (Golang) — Part I&lt;/a&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Intermediate-level article which covers some more advanced pitfalls of deferred funcs.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🐦 Twitter
&lt;/h1&gt;

&lt;p&gt;I also have started tweeting almost daily 2 months ago. I tweet a lot of tips and tricks and exercise questions about Go. I see that it helps many people out there.&lt;/p&gt;

&lt;p&gt;Check them out &lt;a href="https://twitter.com/inancgumus"&gt;here&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;I’m also creating an online course for Go → &lt;a href="http://eepurl.com/c4DMNX"&gt;Join to my newsletter&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Let’s stay in touch weekly for new tutorials and tips.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;👍 Subscribers will get the discounted price (and even free) for my course when it’s get published.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KpvX3-XV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/13s08go8m7epb1y6973n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KpvX3-XV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/13s08go8m7epb1y6973n.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>5 More Gotchas of Defer in Go — Part II</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 21 Dec 2017 15:59:58 +0000</pubDate>
      <link>https://forem.com/inancx/5-more-gotchas-of-defer-in-gopart-ii-4dd1</link>
      <guid>https://forem.com/inancx/5-more-gotchas-of-defer-in-gopart-ii-4dd1</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuigqjmfdic34nq31n0ex.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Z to A&lt;/li&gt;
&lt;li&gt;Scope ate my param&lt;/li&gt;
&lt;li&gt;Quick to run the params&lt;/li&gt;
&lt;li&gt;Captured in a Loop&lt;/li&gt;
&lt;li&gt;Point of no return?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;👉 &lt;a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa" rel="noopener noreferrer"&gt;Press here to read the new article&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See you in two weeks!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com" rel="noopener noreferrer"&gt;Learn Go Programming&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 I’m tweeting tips and tricks about Go almost daily, &lt;a href="https://twitter.com/inancgumus" rel="noopener noreferrer"&gt;follow me on twitter&lt;/a&gt; and get them.&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>5 Gotchas of Defer in Go — Part I</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 07 Dec 2017 18:33:55 +0000</pubDate>
      <link>https://forem.com/inancx/5-gotchas-of-defer-in-gopart-i-1b2</link>
      <guid>https://forem.com/inancx/5-gotchas-of-defer-in-gopart-i-1b2</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--08jh-g4T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v1jj8a9icie3jmxi8kcm.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Deferred nil func&lt;/li&gt;
&lt;li&gt;Defer inside a loop&lt;/li&gt;
&lt;li&gt;Defer as a wrapper&lt;/li&gt;
&lt;li&gt;Defer in a block&lt;/li&gt;
&lt;li&gt;Deferred method gotchas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;👉 &lt;a href="https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01"&gt;Press here to read the new article&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See you in two weeks!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com"&gt;Learn Go Programming&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 I’m tweeting tips and tricks about Go almost daily, &lt;a href="https://twitter.com/inancgumus"&gt;follow me on twitter&lt;/a&gt; and get them.&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Go Defer Simplified with Practical Visuals</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 23 Nov 2017 17:20:39 +0000</pubDate>
      <link>https://forem.com/inancx/go-defer-simplified-with-practical-visuals-25o</link>
      <guid>https://forem.com/inancx/go-defer-simplified-with-practical-visuals-25o</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/golang-defer-simplified-77d3b2b817ff"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SVU5K0wL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/pgdnb8ga5x09n7wi77pr.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What is defer?&lt;/li&gt;
&lt;li&gt;Releasing acquired resources&lt;/li&gt;
&lt;li&gt;Save us from panic&lt;/li&gt;
&lt;li&gt;Deferred closure&lt;/li&gt;
&lt;li&gt;Params evaluation&lt;/li&gt;
&lt;li&gt;Multiple defers&lt;/li&gt;
&lt;li&gt;Deferred methods&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-defer-simplified-77d3b2b817ff"&gt;Click here to read the tutorial&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;See you in two weeks! Please share this tutorial with your friends.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://twitter.com/inancgumus"&gt;@inancgumus&lt;/a&gt; - &lt;em&gt;I share Go tips and tricks on twitter.&lt;/em&gt;&lt;br&gt;
📚 &lt;a href="https://blog.learngoprogramming.com"&gt;Learn Go Programming&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Learn Go Programming - The Zoo of Go Funcs</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 09 Nov 2017 19:52:16 +0000</pubDate>
      <link>https://forem.com/inancx/learn-go-programming---the-zoo-of-go-funcs-a07</link>
      <guid>https://forem.com/inancx/learn-go-programming---the-zoo-of-go-funcs-a07</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/go-functions-overview-anonymous-closures-higher-order-deferred-concurrent-6799008dde7b" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq7r3gsj0ylwrlrdzerkd.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Named and variadic&lt;/li&gt;
&lt;li&gt;Methods&lt;/li&gt;
&lt;li&gt;Interface Methods&lt;/li&gt;
&lt;li&gt;First-class&lt;/li&gt;
&lt;li&gt;Anonymous&lt;/li&gt;
&lt;li&gt;Higher-Order&lt;/li&gt;
&lt;li&gt;Defer&lt;/li&gt;
&lt;li&gt;Concurrent&lt;/li&gt;
&lt;li&gt;Others: Recursive, Black-Hole, Inlined, and External Funcs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/go-functions-overview-anonymous-closures-higher-order-deferred-concurrent-6799008dde7b" rel="noopener noreferrer"&gt;Click here to read the guide&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;See you next week!&lt;/p&gt;




&lt;p&gt;&lt;a href="https://twitter.com/inancgumus" rel="noopener noreferrer"&gt;@inancgumus&lt;/a&gt;&lt;br&gt;
ðŸ“š &lt;a href="https://blog.learngoprogramming.com" rel="noopener noreferrer"&gt;Learn Go Programming&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>★ Ultimate Guide to Go Variadic Funcs</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 02 Nov 2017 14:25:34 +0000</pubDate>
      <link>https://forem.com/inancx/-ultimate-guide-to-go-variadic-funcs-4k4</link>
      <guid>https://forem.com/inancx/-ultimate-guide-to-go-variadic-funcs-4k4</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxw7579bagf45s4032obc.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;✪ What is a variadic func?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✪ When to use a variadic func?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;✪ Slices and the Variadic Funcs&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using without params&lt;/li&gt;
&lt;li&gt;How to pass an existing slice?&lt;/li&gt;
&lt;li&gt;Passed slice’s spooky action at a distance&lt;/li&gt;
&lt;li&gt;Passing multiple slices on-the-fly&lt;/li&gt;
&lt;li&gt;Returning the passed slice&lt;/li&gt;
&lt;li&gt;Expanding operator anti-pattern&lt;/li&gt;
&lt;li&gt;Using the length of a variadic param&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;✪ Signature of a variadic func&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;✪ Mixing variadic and non-variadics params&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepting variables types of arguments&lt;/li&gt;
&lt;li&gt;Why does not Printf only accept just one variadic param?&lt;/li&gt;
&lt;li&gt;Beware the empty interface type&lt;/li&gt;
&lt;li&gt;Passing a slice to variadic param with an empty-interface&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;✪ Functional programming aspects&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using a func’s result slice as a variadic param&lt;/li&gt;
&lt;li&gt;Variadic options pattern example&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  ★ &lt;a href="https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085" rel="noopener noreferrer"&gt;Click here to read the guide&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;See you next week!&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🐣 Go Funcs — Baby-Gopher’s Visual Guide</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Fri, 27 Oct 2017 17:52:57 +0000</pubDate>
      <link>https://forem.com/inancgumus/-go-funcsbaby-gophers-visual-guide-3mj</link>
      <guid>https://forem.com/inancgumus/-go-funcsbaby-gophers-visual-guide-3mj</guid>
      <description>

&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/golang-funcs-params-named-result-values-types-pass-by-value-67f4374d9c0a"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X7Zul9pf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/31eq1x16okmwieyoivue.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is inside?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How to declare a Go function?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Parameters&lt;/li&gt;
&lt;li&gt;Signature&lt;/li&gt;
&lt;li&gt;Body&lt;/li&gt;
&lt;li&gt;Return keyword&lt;/li&gt;
&lt;li&gt;Block&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Func Parameters and Result Types Examples&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Niladic Funcs&lt;/li&gt;
&lt;li&gt;Singular Funcs&lt;/li&gt;
&lt;li&gt;Multiple input params and result types&lt;/li&gt;
&lt;li&gt;Example with an error value&lt;/li&gt;
&lt;li&gt;Discarding the result values&lt;/li&gt;
&lt;li&gt;Named result param and the naked return&lt;/li&gt;
&lt;li&gt;The shadowing problem&lt;/li&gt;
&lt;li&gt;Pass-by-value&lt;/li&gt;
&lt;li&gt;Pass-by-value and the pointers&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Naming Funcs&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Be a Minimalist&lt;/li&gt;
&lt;li&gt;Name in MixedCaps&lt;/li&gt;
&lt;li&gt;Descriptive param names&lt;/li&gt;
&lt;li&gt;Use verbs&lt;/li&gt;
&lt;li&gt;Use is / are&lt;/li&gt;
&lt;li&gt;Omit types in the name&lt;/li&gt;
&lt;li&gt;Getters and Setters&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Some things Go funcs don’t support&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ★ &lt;a href="https://blog.learngoprogramming.com/golang-funcs-params-named-result-values-types-pass-by-value-67f4374d9c0a"&gt;Click here to read the guide&lt;/a&gt;.
&lt;/h2&gt;

&lt;p&gt;See you next Friday!&lt;/p&gt;


</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Ultimate Visual Guide to Go Enums</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Thu, 19 Oct 2017 17:10:45 +0000</pubDate>
      <link>https://forem.com/inancx/ultimate-visual-guide-to-go-enums-ee2</link>
      <guid>https://forem.com/inancx/ultimate-visual-guide-to-go-enums-ee2</guid>
      <description>&lt;p&gt;&lt;strong&gt;Go enums and iota — Full of tips and tricks with runnable code examples.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is an Enum?&lt;/li&gt;
&lt;li&gt;Why do we need enums?&lt;/li&gt;
&lt;li&gt;How can you imitate an enum in Go?&lt;/li&gt;
&lt;li&gt;Creating enum strings automatically&lt;/li&gt;
&lt;li&gt;How to use iota?&lt;/li&gt;
&lt;li&gt;Iota expressions rules with examples&lt;/li&gt;
&lt;li&gt;Iota insights&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;★ &lt;a href="https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3"&gt;Click here to read the article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2vw45fuk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/maxotj4gzqbzvckkolhi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2vw45fuk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/maxotj4gzqbzvckkolhi.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Learn Go Programmingâ€Š–â€ŠMonthly Recap 1</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Wed, 18 Oct 2017 00:46:55 +0000</pubDate>
      <link>https://forem.com/inancx/learn-go-programmingmonthly-recap-af</link>
      <guid>https://forem.com/inancx/learn-go-programmingmonthly-recap-af</guid>
      <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;It was a long month. I spent 250+ hours to create the articles. Let me summarize what I wrote lately, so, you don’t miss anything.&lt;/p&gt;




&lt;h1&gt;
  
  
  Overview:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/about-go-language-an-overview-f0bee143597c"&gt;About Go Languageâ€Š–â€ŠAn Overview&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Go ecosystem and the language’s overview.&lt;/em&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Packages:
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zl52J4rK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rik2paa40qbqrx45vi04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zl52J4rK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rik2paa40qbqrx45vi04.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/definitive-guide-to-go-packages-focus-on-the-fundamentals-to-empower-your-skills-d14aae7cd321"&gt;Introduction to Go Packages&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;What is a package?&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/go-packages-summary-6d40ba46a6f4"&gt;Go Packages Rulebook&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Summarizing the rules for reference.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/using-packages-eb70cb61a16a"&gt;How to use packages&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/code-organization-tips-with-packages-d30de0d11f46"&gt;Organize your code with packages.&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;How to design a Go program with packages.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/packages-can-allow-or-disallow-for-reusability-2edb6bd18815"&gt;How to decouple your packages&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;How to increase code maintainability with packages.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/special-packages-and-directories-in-go-1d6295690a6b"&gt;Special Packages and Directories&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;About internal, main, library and vendor directories.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/what-are-goroot-and-gopath-1231b084723f"&gt;Fix your $GOPATH and $GOROOT&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;How to configure them and they do.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Storage Mechanisms:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Variables:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/learn-go-lang-variables-visual-tutorial-and-ebook-9a061d29babe"&gt;Visual guide to Go Variables&lt;/a&gt;&lt;/strong&gt;
&lt;em&gt;All about variables with visual examples.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/learn-go-lang-variables-visual-tutorial-and-ebook-9a061d29babe"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TsEV6tNC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ek7yr0r05ob4l5pe859u.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/golang-short-variable-declaration-rules-6df88c881ee"&gt;Short-variable declarations rulebook&lt;/a&gt;&lt;/strong&gt;
&lt;em&gt;Tips and tricks about how to use short-variables.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/golang-short-variable-declaration-rules-6df88c881ee"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--69LKACGZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uhwbzdudm6wfnnj5s9sm.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Constants:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61"&gt;Visual guide to Go Constants&lt;/a&gt;&lt;/strong&gt;
&lt;em&gt;All about typed and untyped constants with visual examples.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R7VlF1b3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1h9m1n1tiwa7rnm108uf.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’ve been a programmer since 1993 and an online teacher and mentor since 2016. Now, I’m working full-time from home to teach Go.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ðŸ¦ &lt;a href="https://twitter.com/inancgumus"&gt;@inancgumus&lt;/a&gt;&lt;br&gt;
ðŸ“š &lt;a href="https://blog.learngoprogramming.com"&gt;Learn Go Programming Blog&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
    </item>
    <item>
      <title>Go Variables - A Visual How-to Guide</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Wed, 11 Oct 2017 14:02:44 +0000</pubDate>
      <link>https://forem.com/inancx/go-variables---a-visual-how-to-guide-19h</link>
      <guid>https://forem.com/inancx/go-variables---a-visual-how-to-guide-19h</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffe6oxvukpya53cakdju2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffe6oxvukpya53cakdju2.png" alt="Go Variables" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Beauty of Go declarations â¤ï¸
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Go defines the variables as they read. Go is explicit and simple.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of doing the arithmetic of Clockwise/Spiral Rule&lt;sup id="fnref1"&gt;1&lt;/sup&gt; to read a C declaration, Go uses a simpler approach for us humans.&lt;/p&gt;

&lt;h4&gt;
  
  
  â†’ C’s version:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flutahppn89k65jkh2zlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flutahppn89k65jkh2zlj.png" alt="C Declaration" width="800" height="274"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Clockwise/Spiral Rule&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  â†’ Go’s version:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5wkruncegu8o05w75kh4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5wkruncegu8o05w75kh4.png" alt="Go Declaration" width="800" height="246"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Humanized&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  What is a variable in Go?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fky6jwlnz6lbujqvj64bp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fky6jwlnz6lbujqvj64bp.png" alt="What is a variable in Go?" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type&lt;/strong&gt; â†’ What kind of information can be stored inside the variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Value&lt;/strong&gt; â†’ The stored value inside the variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Address&lt;/strong&gt; â†’ Where the variable can be found in computer memory.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why do we need variables?
&lt;/h2&gt;

&lt;p&gt;Without variables, there would be only static-data in our programs that we can’t change. &lt;strong&gt;Variables let us do dynamic things&lt;/strong&gt;, such as getting user feedback, and re-using the same value again.&lt;/p&gt;


&lt;h2&gt;
  
  
  How to declare a Go variable?
&lt;/h2&gt;

&lt;p&gt;It’s better to talk about zero-values first. If you declare a variable without a value, then it’ll have a zero-value depending on the type of the variable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23o2oeim56a30tidx1ec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23o2oeim56a30tidx1ec.png" alt="Zero Values" width="800" height="480"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Left side gets right side’s values if not initialized.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Long Declaration
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gs2zjhpwxqrhmocuthm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gs2zjhpwxqrhmocuthm.png" alt="Long Variable Declaration" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Declares a variable named ageOfUniverse with type of int.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Name can be anything including unicodes like Ï€, âˆ‘, âˆ«, but not this: ðŸ˜±. Its value is a zero-value of an int which is 0.&lt;/p&gt;


&lt;h2&gt;
  
  
  Short Declaration
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5r4sonidswctv0en9mml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5r4sonidswctv0en9mml.png" alt="Short Variable Declaration" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Declares a variable named ageOfUniverse and stores a value of 14 billions in the variable and guesses its type automatically (type-inferring).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The variable is declared and its value and type are assigned all together with &lt;code&gt;:=&lt;/code&gt; operator. When you use short declaration, Go will not use a zero-value assignment, obviously. ðŸ‘‹ &lt;em&gt;Pascal programmers may remember &lt;code&gt;:=&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;ðŸ‘‰ &lt;em&gt;For more info, you may read the &lt;a href="https://blog.learngoprogramming.com/golang-short-variable-declaration-rules-6df88c881ee" rel="noopener noreferrer"&gt;Short Declarations Rulebook&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Multiple declaration
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhrlu99ocysogzqcm766.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhrlu99ocysogzqcm766.png" alt="Multiple Variable Declaration" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Declares multiple variables which have different types and values in the same statement.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The number of items on the left-hand side (&lt;em&gt;which is: livablePlanets and ageOfEarth&lt;/em&gt;) should match to the number of items on the right-hand side (&lt;em&gt;which is: 1 and 4.5e9&lt;/em&gt;).&lt;/p&gt;


&lt;h2&gt;
  
  
  Multiple short declaration
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb64vkkx1a1moujy2kcak.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb64vkkx1a1moujy2kcak.png" alt="Multiple Short Variable Declaration" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Declares two variables of type float64 and string; and assigns 14 billions to the first and “go” to the second variable.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Assigning values
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihomq0k7b12ddx2amqym.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihomq0k7b12ddx2amqym.png" alt="Simple Assignment" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8xn8e2awgjfpoodpheps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8xn8e2awgjfpoodpheps.png" alt="Multiple Assignment" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you want to assign a wrong type of data to a variable, Go compiler will fail to compile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe7r4qx50hu6arpadcck7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe7r4qx50hu6arpadcck7.png" alt="Wrong Assignment" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  ðŸ’¡ Which declaration form should I use?
&lt;/h2&gt;

&lt;p&gt;Use long declaration when you can’t know what data to store beforehand, otherwise, use short declaration. Use multiple declaration when you want to define multiple variables together or as an hint for code readability that the variables will be used together.&lt;/p&gt;

&lt;p&gt;You can’t use short declarations outside of functions including main function. Or: you will meet with this error: &lt;em&gt;“syntax error: non-declaration statement outside function body”&lt;/em&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  How variables are stored?
&lt;/h2&gt;

&lt;p&gt;When we declare an integer variable, 4-bytes of storage space in the memory for the variable is reserved. When the data doesn’t fit into the variable, Go compiler will terminate.&lt;/p&gt;

&lt;p&gt;However, &lt;em&gt;int&lt;/em&gt; is a floppy type, its capacity can change. So, we can’t just simply store the age of the universe in an int variable. We should have used &lt;em&gt;uint64&lt;/em&gt; instead. An &lt;em&gt;int&lt;/em&gt; can’t store ~14 billions of years, it can only store up to ~4 billions of years on 32-bit machines. Or it will overflow, but for a 64-bit machine, compilation will work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58u3uciuy0bh17cog4w7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58u3uciuy0bh17cog4w7.png" alt="How Golang Variables are Stored" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try it yourself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"unsafe"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;ageOfUniverse&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;reservedBytes&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;unsafe&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ageOfUniverse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Number of bytes reserved for `ageOfUniverse` variable is %d bytes.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;reservedBytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;a href="https://play.golang.org/p/SV95kReYNm" rel="noopener noreferrer"&gt;Play with it&lt;/a&gt;: Example shows you how many bytes the ageOfUniverse variable can store.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;// on 32-bit machines, it'll overflow&lt;/span&gt;
&lt;span class="c"&gt;// on 64-bit machines, everything is fine&lt;/span&gt;
&lt;span class="c"&gt;// use: uint64 instead.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;ageOfUniverse&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;14e9&lt;/span&gt; &lt;span class="c"&gt;// 14e9 = 14 and 9 zeros which is 14 billions&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"`ageOfUniverse` is %d.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ageOfUniverse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Incorrect code. &lt;a href="https://play.golang.org/p/IOQjUKSIC1" rel="noopener noreferrer"&gt;Run it to see yourself&lt;/a&gt;.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// still not a good way to define a variable like this. we will see it.&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;ageOfUniverse&lt;/span&gt; &lt;span class="kt"&gt;uint64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;14e9&lt;/span&gt; &lt;span class="c"&gt;// 14e9 = 14 and 9 zeros which is 14 billions&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"`ageOfUniverse` is %d.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ageOfUniverse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Correct-ish code. &lt;a href="https://play.golang.org/p/q5fnpQCqxl" rel="noopener noreferrer"&gt;Run it&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Making a variable accessible to other packages
&lt;/h2&gt;

&lt;p&gt;This is called &lt;em&gt;exporting&lt;/em&gt;. To define a variable in the package scope, you can only use long declaration or multiple declaration. After that, you need to capitalize its first letter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9y2wvtpb6k2qpf66msd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9y2wvtpb6k2qpf66msd.png" alt="Making a variable accessible to other packages" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;ðŸ”¥ &lt;strong&gt;I’m creating an online course for Go: &lt;a href="http://eepurl.com/c4DMNX" rel="noopener noreferrer"&gt;Join to my newsletter&lt;/a&gt;&lt;/strong&gt;!&lt;br&gt;
&lt;em&gt;Let’s stay in touch weekly for new tutorials and for my online Go course.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;â¤ï¸ &lt;strong&gt;&lt;a href="http://bit.ly/golang-variables" rel="noopener noreferrer"&gt;Please Share this post on twitter&lt;/a&gt;&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;ðŸ¦ I’m mostly tweeting about Go: &lt;a href="https://twitter.com/inancgumus" rel="noopener noreferrer"&gt;@inancgumus&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article originally published as &lt;a href="https://blog.learngoprogramming.com/learn-go-lang-variables-visual-tutorial-and-ebook-9a061d29babe" rel="noopener noreferrer"&gt;Learn Go variables–A visual guide&lt;/a&gt; in &lt;a href="https://blog.learngoprogramming.com" rel="noopener noreferrer"&gt;Learn Go Programming&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="http://c-faq.com/decl/spiral.anderson.html" rel="noopener noreferrer"&gt;http://c-faq.com/decl/spiral.anderson.html&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>go</category>
      <category>programming</category>
    </item>
    <item>
      <title>Learn Go: Constants with visual examples</title>
      <dc:creator>Inanc Gumus</dc:creator>
      <pubDate>Tue, 10 Oct 2017 13:37:12 +0000</pubDate>
      <link>https://forem.com/inancx/learn-go-constants-with-visual-examples-beb</link>
      <guid>https://forem.com/inancx/learn-go-constants-with-visual-examples-beb</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j3ivbN4u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/02yognhwhrbr6d8li2tv.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;ðŸ”¥ &lt;a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61"&gt;I published a new post&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In the post I'm talking about:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Benefits of constants&lt;/li&gt;
&lt;li&gt;What is a constant&lt;/li&gt;
&lt;li&gt;Typed constants&lt;/li&gt;
&lt;li&gt;Untyped constants&lt;/li&gt;
&lt;li&gt;Default types&lt;/li&gt;
&lt;li&gt;Ideal types&lt;/li&gt;
&lt;li&gt;High-Precision calculations with untyped constants&lt;/li&gt;
&lt;li&gt;Flexible expressions with untyped constants&lt;/li&gt;
&lt;li&gt;Scopes and Shadowing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please share this on &lt;a href="http://tinyurl.com/yd5uxrem"&gt;twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;â†’ &lt;a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61"&gt;Click to read the article&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;ðŸ¦ My twitter: &lt;a href="https://twitter.com/inancgumus"&gt;@inancgumus&lt;/a&gt;.&lt;br&gt;
ðŸ”¥ I’m creating an online course for Go: &lt;a href="http://eepurl.com/c4DMNX"&gt;Join to my newsletter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
