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.
For loops in a nutshell
The for loop is the only looping construct in Go: three-component loop, while loop, infinite loop, for-each loop, break and continue.
Switch statements in a nutshell
A switch-case-default statement is a shorter and cleaner way to write a sequence of if-else statements: no condition, case lists, fallthrough, break and continue, execution order.
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: