This skill provides patterns and best practices for using Go programming language, including idiomatic code structure, error handling, concurrency, and testing.
gofmt to format your code consistently.testing package and aim for high test coverage.nilnil slices or maps from public APIs.[]T{}) unless nil has meaning.nil and empty are interchangeable.%w.defer Correctlydefer executes at function return, not block exit.defer inside loops unless wrapped in a function literal.defer immediately after resource acquisition.context.Contextcontext.Context, it must observe cancellation.ctx.Done() in loops and before blocking work.sync.Mutex, sync.RWMutex, or justified sync.Map.If correctness, simplicity, and idiomatic Go conflict with cleverness or abstraction — choose simplicity.