I’d been working with Node.js for many years and then with Go within my latest projects. I’ve been programming since 1992. I want to share what I learned about Go with you.
I’ll go into the details of each piece of information here in this post afterward, in the next posts. This post is here for giving you a quick overview of Go without going into the language-specific details and tutorials.
Go is an open source programming language from Google. Made its first stable release, 2011.
This article is more about tricks rather than gotchas of defer.
Read the following posts from this series to discover more gotchas and tricks about defer:
If you don’t know how defer works please read this starter post first:
We’re continuing our journey of defer gotchas.
This can become a gotcha when you’re learning Go for the first time.
🐼 This article is only for beginner to intermediate level Gophers, masters: “close the tab please”.
If a deferred func evaluates to
nil, execution panics when the surrounding func ends not when defer is called.
Alright, that’s all for now. Thank you for reading so far.
This post is a summary for the different kind of funcs in Go. I’ll go into more detail in the upcoming posts because they deserve more. This is just a start.
A variadic func accepts variable number of input values — zero or more. Ellipsis (three-dots) prefix in front of an input type makes a func variadic.
Note: This guide is only about introducing Go functions, not about: variadic, defer, and external funcs; or methods, http, and marshaling, etc.
A function is a separate and reusable block of code which can be run again and again. Functions may accept input values and they may return output values.
Coder. Gopher. Maker. Stoic. Since 1992.