Export High-Res PDF
Switch to Light Mode
SkillSnap Official GuideUpdated 7/24/2026
Go (Golang)
The language of the cloud. Master goroutines, channels, and the 'one way to do it' philosophy for robust systems.
Philosophy & Syntax
Format code (Non-negotiable)gofmt / goimports
Short variable declarationname := val
Standard error checking loopif err != nil
Cleanup (LIFO execution)defer
Avoid using (Hard to test/track)init()
Concurrency (Goroutines)
Start Goroutine (~2KB stack)go func()
Unbuffered Channel (Blocks)make(chan T)
Buffered Channel (Non-blocking until full)make(chan T, n)
Wait on multiple channelsselect
Wait for multiple routinessync.WaitGroup
Detect Race Conditionsgo test -race
Error Handling
Check specific error typeerrors.Is(err, target)
Cast to specific implementationerrors.As(err, &target)
Wrap error with contextfmt.Errorf("%w", err)
Use only for unrecoverable crashespanic / recover
Context & Flow
Pass as first argumentctx context.Context
Prevent hanging servicescontext.WithTimeout
Stop goroutines on request endcontext.WithCancel
Performance & Tooling
Performance testsBenchmarkXxx
CPU/Memory Profilingpprof
Efficient string concatenationstrings.Builder
Check Escape Analysisgo build -gcflags="-m"
Data & JSON
Struct tag to hide empty fieldsjson:"name,omitempty"
Stream large JSON filesjson.Decoder
Modern sorting (1.21+)slices.Sort
Production Ready
Clean dependenciesgo mod tidy
Embed static assets in binary//go:embed
Build static binaryCGO_ENABLED=0
Structured Logging (1.21+)slog