Agent skill

Language

Core idioms, style guides, and best practices for writing idiomatic Go code.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/language-hoangnguyen0403-agent-skills-standar-3

Metadata

Additional technical details for this skill

labels
golang style idioms best-practices
triggers
{
    "files": [
        "**/*.go",
        "go.mod"
    ],
    "keywords": [
        "golang",
        "go code",
        "style",
        "idiomatic"
    ]
}

SKILL.md

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

  • Idioms
  • Effective Go Summary

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results