
Go by Example
Check out the first example or browse the full list below. Unless stated otherwise, examples here assume the latest major release Go and may use new language features.
Go by Example: Reading Files
Go by Example: Reading Files Next example: Writing Files.
Go by Example: Hello World
Go by Example: Hello World Next example: Values.
: Generics - Go by Example
$ go run generics.go index of zoo: 2 list: [10 13 23]
Go by Example: Select
Go by Example: Select Next example: Timeouts.
Go by Example: Functions
Go by Example: Functions Next example: Multiple Return Values.
Go by Example: Recursion
Go by Example: Recursion Next example: Range over Built-in Types.
Go by Example: Interfaces
Go by Example: Interfaces Next example: Enums.
: Maps - Go by Example
: Maps ... Note that maps appear in the form map[k:v k:v] when printed with fmt.Println. $ go run maps.go map: map[k1:7 k2:13] v1: 7 v3: 0 len: 2 map: map[k1:7] map: map[] prs: false map: …
: Arrays - Go by Example
: Arrays Next example: Slices.