Languages
Go
Slices, maps, errors and concurrency primitives for everyday Go.
Tooling
go mod init example.com/appInitialize a modulego test ./...Run package testsgo vet ./...Run static correctness checksgofmt -w main.goFormat a source fileCollections and errors
names := []string{"Ada", "Lin"}Create a slicenames = append(names, "Sam")Append and retain the resulting slicescores := map[string]int{"Ada": 10}Create a mapvalue, ok := scores["Ada"]Distinguish missing keys from zero valuesFunctions and concurrency
func add(a, b int) int { return a + b }Define a typed functionif err != nil { return fmt.Errorf("load: %w", err) }Wrap an error while preserving its causego work()Start a goroutine; coordinate its lifecycle explicitlych := make(chan int, 1)Create a channel with capacity one