Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Sat, 23 Dec 2017 19:40:00 +0000 The Zoo of Go Functions #tutorials #learngoprogramming <div class="section-inner sectionLayout--insetColumn"> <p>An overview of anonymous, higher-order, closures, concurrent, deferred, and other kinds of Golang&nbsp;functions.</p> <h2>What is&nbsp;inside?</h2> <ul> <li>Named and variadic funcs</li> <li>Methods</li> <li>Interface methods</li> <li>First-class funcs</li> <li>Anonymous funcs</li> <li>Higher-Order funcs</li> <li>Deferred funcs</li> <li>Concurrent funcs</li> <li>Others: Recursive, Black-Hole, Inlined, and External funcs.</li> </ul></div><div class="section-inner sectionLayout--fullWidth"><figure name="bc40" id="bc40" class="graf graf--figure graf--layoutFillWidth graf-after--h4" data-scroll="native" style="margin: 44px 0px 80px; position: relative; clear: both; outline: 0px; box-sizing: border-box; user-select: auto; z-index: 100;"><div class="aspectRatioPlaceholder is-locked"></div></figure></div> 6 points posted by blackflicker https://blog.learngoprogramming.com/go-functions-overview-anonymous-closures-higher-order-deferred-concurrent-6799008dde7b 2969 Tue, 28 Nov 2017 16:01:00 +0000 5 More Gotchas and Tricks of Defer in Go — Part III #learngoprogramming <h2>What is inside?</h2><ul style="padding-left: 6px; margin: 0.8em 0.7em 0.8em 1.9em; list-style-type: square; color: rgb(10, 10, 10); font-family: Palatino, &quot;Palatino Linotype&quot;, &quot;Palatino LT STD&quot;, &quot;Book Antiqua&quot;, Georgia, serif; font-size: 21px;"><li style="margin: 0.3em auto;">Calling recover outside of a deferred func</li><li style="margin: 0.3em auto;">Calling defer in the wrong order</li><li style="margin: 0.3em auto;">Not checking for errors</li><li style="margin: 0.3em auto;">Releasing the same resource twice</li><li style="margin: 0.3em auto;">panic/recover can get and return any type</li> </ul> 5 points posted by blackflicker https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-iii-36a1ab3d6ef1 3120 Thu, 18 Jan 2018 22:22:00 +0000 Learn Go Programming - Yearly Recap #learngoprogramming <p name="67f1" id="67f1" class="graf graf--p graf-after--figure"><div class="section-inner sectionLayout--fullWidth"><figure name="558e" id="558e" class="graf graf--figure graf--layoutFillWidth graf-after--li" data-scroll="native" style="display: block; margin: 80px 0px; position: relative; clear: both; outline: 0px; box-sizing: border-box; user-select: auto; z-index: 100;"><div class="aspectRatioPlaceholder is-locked"></div></figure></div></p><div class="section-inner sectionLayout--insetColumn"><h3 name="556f" id="556f" class="graf graf--h3 graf-after--figure">Articles from&nbsp;2017</h3><p name="63a7" id="63a7" class="graf graf--p graf-after--h3">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.</p><h4 name="50cc" id="50cc" class="graf graf--h4 graf-after--p">★ Overview</h4><ul class="postList" style="margin: 10px 0px 0px; padding: 0px; list-style: none none; counter-reset: post 0;"><li name="261f" id="261f" class="graf graf--li graf-after--h4" style="margin-left: 30px; margin-bottom: 0px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/about-go-language-an-overview-f0bee143597c" data-href="https://blog.learngoprogramming.com/about-go-language-an-overview-f0bee143597c" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">About Go Language — An Overview</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Go ecosystem and the language’s overview.</em></li> </ul><h4 name="9604" id="9604" class="graf graf--h4 graf-after--li">★ Go&nbsp;Packages</h4><ul class="postList" style="margin: 10px 0px 0px; padding: 0px; list-style: none none; counter-reset: post 0;"><li name="9863" id="9863" class="graf graf--li graf-after--h4" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/definitive-guide-to-go-packages-focus-on-the-fundamentals-to-empower-your-skills-d14aae7cd321" data-href="https://blog.learngoprogramming.com/definitive-guide-to-go-packages-focus-on-the-fundamentals-to-empower-your-skills-d14aae7cd321" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Introduction to Go Packages</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">What is a package?</em></li><li name="a6c7" id="a6c7" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/using-packages-eb70cb61a16a" data-href="https://blog.learngoprogramming.com/using-packages-eb70cb61a16a" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">How to use packages</strong></a><strong class="markup--strong markup--li-strong" style="font-weight: 700;"><br></strong><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">How to use your own, others’ and Go standard library’s packages?</em></li><li name="fcce" id="fcce" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/special-packages-and-directories-in-go-1d6295690a6b" data-href="https://blog.learngoprogramming.com/special-packages-and-directories-in-go-1d6295690a6b" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Special Packages and Directories</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">About internal, main, library and vendor directories.</em></li><li name="7a46" id="7a46" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/code-organization-tips-with-packages-d30de0d11f46" data-href="https://blog.learngoprogramming.com/code-organization-tips-with-packages-d30de0d11f46" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Organize your code with packages</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">How to design a Go program with packages.</em></li><li name="1e3a" id="1e3a" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/packages-can-allow-or-disallow-for-reusability-2edb6bd18815" data-href="https://blog.learngoprogramming.com/packages-can-allow-or-disallow-for-reusability-2edb6bd18815" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">How to decouple your packages</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">How to increase code maintainability with packages.</em></li><li name="ae70" id="ae70" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/go-packages-summary-6d40ba46a6f4" data-href="https://blog.learngoprogramming.com/go-packages-summary-6d40ba46a6f4" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Go Packages Rulebook</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Summarizing the rules for reference.</em></li><li name="c140" id="c140" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 0px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/what-are-goroot-and-gopath-1231b084723f" data-href="https://blog.learngoprogramming.com/what-are-goroot-and-gopath-1231b084723f" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Fix your $GOPATH and $GOROOT</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">How to configure them and what they do.</em></li> </ul><h4 name="8afe" id="8afe" class="graf graf--h4 graf-after--li">★ Variables</h4><ul class="postList" style="margin: 10px 0px 0px; padding: 0px; list-style: none none; counter-reset: post 0;"><li name="2115" id="2115" class="graf graf--li graf-after--h4" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/learn-go-lang-variables-visual-tutorial-and-ebook-9a061d29babe" data-href="https://blog.learngoprogramming.com/learn-go-lang-variables-visual-tutorial-and-ebook-9a061d29babe" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Visual guide to Go Variables</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Introduction to variables and declaration styles.</em></li><li name="3221" id="3221" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 0px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/golang-short-variable-declaration-rules-6df88c881ee" data-href="https://blog.learngoprogramming.com/golang-short-variable-declaration-rules-6df88c881ee" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Short-variable declarations rulebook</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Tips and tricks about how to use short-variables. Intermediate-level.</em></li> </ul><h4 name="455b" id="455b" class="graf graf--h4 graf-after--li">★ Constants</h4><ul class="postList" style="margin: 10px 0px 0px; padding: 0px; list-style: none none; counter-reset: post 0;"><li name="2b10" id="2b10" class="graf graf--li graf-after--h4" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61" data-href="https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Visual guide to Go Constants</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Introduction to untyped and typed constants.</em></li><li name="7504" id="7504" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 0px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3" data-href="https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Ultimate Visual Guide to Go Enums</strong></a><strong class="markup--strong markup--li-strong" style="font-weight: 700;"><br></strong><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">How to define an enum in Go and how to use iota?</em></li> </ul><h4 name="35eb" id="35eb" class="graf graf--h4 graf-after--li">★ Functions</h4><ul class="postList" style="margin: 10px 0px 0px; padding: 0px; list-style: none none; counter-reset: post 0;"><li name="8218" id="8218" class="graf graf--li graf-after--h4" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/golang-funcs-params-named-result-values-types-pass-by-value-67f4374d9c0a" data-href="https://blog.learngoprogramming.com/golang-funcs-params-named-result-values-types-pass-by-value-67f4374d9c0a" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Funcs — Baby-Gopher’s Visual Guide</strong></a><strong class="markup--strong markup--li-strong" style="font-weight: 700;"><br></strong><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Introducing Go functions with examples.</em></li><li name="a957" id="a957" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/go-functions-overview-anonymous-closures-higher-order-deferred-concurrent-6799008dde7b" data-href="https://blog.learngoprogramming.com/go-functions-overview-anonymous-closures-higher-order-deferred-concurrent-6799008dde7b" class="markup--anchor markup--li-anchor" rel="noopener" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">The Zoo of Go Functions</strong></a><strong class="markup--strong markup--li-strong" style="font-weight: 700;"><br></strong><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Introductory tour of anonymous, higher-order, closure, concurrent, deferred, variadic funcs and methods.</em></li><li name="f0cd" id="f0cd" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085" data-href="https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085" class="markup--anchor markup--li-anchor" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Ultimate Guide to Go Variadic Funcs</strong></a><strong class="markup--strong markup--li-strong" style="font-weight: 700;"><br></strong><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">A variadic func accepts variable number of input values — zero or more. The article covers everything about variadic funcs.</em></li><li name="6c14" id="6c14" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/golang-defer-simplified-77d3b2b817ff" data-href="https://blog.learngoprogramming.com/golang-defer-simplified-77d3b2b817ff" class="markup--anchor markup--li-anchor" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Defer Simplified with Practical Visuals</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Introduction to deferred functions. Includes deferred funcs, multiple defers, deferred methods, deferred closures, and other examples.</em></li><li name="3b81" id="3b81" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/yeah-semantically-after-is-the-right-word-fad1d5181891" data-href="https://blog.learngoprogramming.com/yeah-semantically-after-is-the-right-word-fad1d5181891" class="markup--anchor markup--li-anchor" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">Defer Internals — Quick Look</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">An intermediate-level article. Asking the question: Are defers run after or before the func returns?</em></li><li name="0938" id="0938" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 14px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa" data-href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa" class="markup--anchor markup--li-anchor" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">5 Gotchas of Defer in Go (Golang) — Part II</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Beginner-level article which covers some basic pitfalls of deferred funcs.</em></li><li name="7dc6" id="7dc6" class="graf graf--li graf-after--li" style="margin-left: 30px; margin-bottom: 0px; --baseline-multiplier:0.17; font-family: medium-content-serif-font, Georgia, Cambria, &quot;Times New Roman&quot;, Times, serif; font-weight: 400; font-style: normal; font-size: 21px; line-height: 1.58; letter-spacing: -0.003em;"><a href="https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01" data-href="https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01" class="markup--anchor markup--li-anchor" target="_blank" style="background-color: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.54); background-image: linear-gradient(rgba(0, 0, 0, 0.68) 50%, rgba(0, 0, 0, 0) 50%); background-repeat: repeat-x; background-size: 2px 0.1em; background-position: 0px 1.07em;"><strong class="markup--strong markup--li-strong" style="font-weight: 700;">5 Gotchas of Defer in Go (Golang) — Part I</strong></a><br><em class="markup--em markup--li-em" style="font-feature-settings: 'liga' 1, 'salt' 1;">Intermediate-level article which covers some more advanced pitfalls of deferred funcs.</em></li> </ul></div> 5 points posted by blackflicker https://blog.learngoprogramming.com/2017-yearly-recap-5349f6d7d67b 3076 Thu, 04 Jan 2018 19:21:00 +0000 5 More Gotchas of Defer in Go — Part II #golang #learngoprogramming <div><b>What is inside?</b></div><div><br></div><div> <ul><li>Z to A</li> <li>Scope ate my param</li> <li>Quick to run the params</li> <li>Captured in a Loop</li> <li>Point of no return?</li> </ul></div><div><br></div><div><a href="https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa">Press here to read the article.</a></div><div><br></div> 3 points posted by blackflicker https://blog.learngoprogramming.com/5-gotchas-of-defer-in-go-golang-part-ii-cc550f6ad9aa 3035 Thu, 21 Dec 2017 16:10:00 +0000 5 Gotchas of Defer in Go - Part I #learngoprogramming <h5><b>What is inside?</b></h5><ul style="margin: 0.357143em 0px 0px; padding: 0px 0px 0px 40px; list-style-position: initial; list-style-image: initial; color: rgb(34, 34, 34); font-family: verdana, arial, helvetica, sans-serif; font-size: 19.1692px; background-color: rgb(255, 255, 255);"><li style="margin: 0px; padding: 0px; font-size: 1em; line-height: 1.42857em;">Deferred nil func</li><li style="margin: 0px; padding: 0px; font-size: 1em; line-height: 1.42857em;">Defer inside a loop</li><li style="margin: 0px; padding: 0px; font-size: 1em; line-height: 1.42857em;">Defer as a wrapper</li><li style="margin: 0px; padding: 0px; font-size: 1em; line-height: 1.42857em;">Defer in a block</li><li style="margin: 0px; padding: 0px; font-size: 1em; line-height: 1.42857em;">Deferred method gotchas</li> </ul><div><br></font></div><div><a href="https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01">Check out.</a></font></div> 3 points posted by blackflicker https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01 3000 Fri, 08 Dec 2017 14:01:00 +0000