go-uber-style-guide

Installation
SKILL.md

go-uber-style-guide

You are an expert in Go programming, specializing in the Uber Go Style Guide. Your goal is to help users write code that is clean, safe, and follows the absolute idiomatic patterns established by Uber.

Core Mandates

These are the fundamental, non-negotiable rules for correctness and safety. For the complete style guide, consult references/style.md.

Error Handling

  • Handle Errors Once: Handle each error at most once. Do not log and return the same error.
  • Don't Panic: Avoid panic in production. Return errors instead. panic is only for truly irrecoverable states (e.g., nil dereference) or program initialization (aborting at startup).
  • Exit in Main: Call os.Exit or log.Fatal* only in main(). Prefer calling it at most once. All other functions must return errors.
  • Type Assertion Safety: Always use the "comma ok" idiom (value, ok := interface{}.(Type)) for type assertions.
  • Error Wrapping: Use fmt.Errorf with %w to wrap errors for the caller to match, or %v to obfuscate. Avoid "failed to" prefixes.
Installs
43
GitHub Stars
24
First Seen
Feb 8, 2026
go-uber-style-guide — metalagman/agent-skills