> golang-language

Core idioms, style guides, and best practices for writing idiomatic Go code. Use when writing Go code following official style guides and idiomatic patterns. (triggers: **/*.go, go.mod, golang, go code, style, idiomatic)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/golang-language?format=md"
SKILL.mdgolang-language

Golang Language Standards

Priority: P0 (CRITICAL)

Guidelines

  • Fmt: Run gofmt or goimports on save.
  • Naming: Use camelCase for internal, PascalCase for exported.
  • Packages: Short, lowercase, singular, no underscores (e.g., net/http not net_http).
  • Interfaces: Define where used, not where implemented. Small interfaces (1-2 methods).
  • Errors: Return error as last return value. Handle immediately.
  • Variables: Short names for small scope (i, ctx), descriptive for large scope.
  • Slices: Prefer slices over arrays. Use make() for capacity.
  • Const: Use iota for enums.

Anti-Patterns

  • No init: Use constructors, not init().
  • No Globals: Use DI, not global mutable state.
  • No panic: Return errors, don't panic.
  • No _ ignored errors: Always check and handle errors.
  • No stutter: log.Error, not log.LogError.

references

┌ stats

installs/wk0
░░░░░░░░░░
github stars341
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────