Skip to content
Guest
← All References
Go Go 1.22+

Go (Golang) Quick Reference

Essential Go syntax for slices, maps, structs, interfaces, error wrapping, goroutines, channels, and testing.

func name(arg T) (R, error)

Core Syntax & Idioms

ConceptExample
Short declarationname := "DevPath"
Slice appenditems = append(items, "Go")
Map comma-okval, ok := m["key"]
Error wrappingfmt.Errorf("load user: %w", err)
Goroutine + WaitGroupwg.Add(1); go func() { defer wg.Done(); work() }()
Buffered channelch := make(chan int, 16)
Context timeoutctx, cancel := context.WithTimeout(ctx, 2*time.Second)
Race detectorgo test -race ./...

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind