Go Basics
| Feature | Example |
| Variables | var name string = "Go" or name := "Go" |
| Constants | const MaxRetries = 3 |
| Functions | func add(a, b int) int { return a + b } |
| Multiple returns | func divide(a, b float64) (float64, error) |
Goroutines & Channels
| Feature | Example |
| Goroutine | go doWork() — runs concurrently |
| Channel | ch := make(chan int) |
| Send/Receive | ch <- 42 send; val := <-ch receive |
| Select | select { case msg := <-ch1: ... case <-ch2: ... } |
Interfaces
| Pattern | Example |
| Define | type Writer interface { Write([]byte) (int, error) } |
| Implement | Any type with a Write method satisfies Writer — implicit, no "implements" keyword |
| Empty interface | interface{} — any type (use any in Go 1.18+) |
Error Handling
| Pattern | Example |
| Standard | if err != nil { return err } |
| Custom error | fmt.Errorf("failed: %w", err) — wraps with %w for unwrapping |
| Defer | defer file.Close() — runs at function exit |
Pro Tip: Go's philosophy: 'Do less, enable more.' The language is deliberately small — 25 keywords. Master goroutines + channels, interfaces, and the standard library. Don't fight the idioms; embrace if err != nil.