Concise descriptions of core Go concepts
Table of contents
Interfaces in a nutshell
An interface type consists of a set of method signatures. A variable of interface type can hold any value that implements these methods. Structural typing, the empty interface, interface values, equality.
Slices in a nutshell
A slice refers to a section of an underlying array. It can grow and shrink within the bounds of this array: construction, slicing, iteration, append and copy, stacks and queues.
Maps in a nutshell
A map is an unordered collection of key-value pairs: make, literals, default zero value, size, add, find, delete, and iterate.
5 basic for loop patterns
The for loop can be used for three-component loops, while loops, infinite loops and for-each range loops. You can exit a loop with break or continue.
5 switch statement patterns
A switch-case-default statement is a shorter and cleaner way to write a sequence of if-else statements.
Packages in a nutshell
Every Go program is made up of packages and each package has an import path: package names, declarations, resolving name conflicts, dot imports, installation, documentation.
The Concurrent programming tutorial covers the fundamentals of concurrent programming with examples in Go.
Follow on Twitter
One useful golang fact per day
Share this page: