go-lang
Installation
SKILL.md
go-lang
Core Concepts
- Goroutines: lightweight threads (go keyword), multiplexed onto OS threads by the runtime scheduler
- Channels: typed conduits for goroutine communication, support buffered/unbuffered and select for multiplexing
- Interfaces: implicit satisfaction, define behavior contracts with zero dependencies between types
- Structs + Methods: value receiver vs pointer receiver, composition over inheritance via embedding
Error Handling
- errors.Is/As: error chain inspection, Is checks sentinel values, As unwraps to target type
- No exceptions: functions return error as last value, caller handles explicitly
- defer/panic/recover: cleanup resources, panic for programmer errors, recover in goroutines only
Modules & Tooling
- go mod: dependency management, semantic import versioning, module cache, checksum database
- go fmt/vet: standardized formatting and static analysis
- go build/install: fast compilation, cross-compilation with GOOS/GOARCH