golang-code-style
golang code style
What it does
- Functions SHOULD be short and focused — one function, one job.
- Functions SHOULD have ≤4 parameters. Beyond that, use an options struct (see samber/cc-skills-golang@golang-design-patterns skill).
- Parameter order: context.Context first, then inputs, then output destinations.
- Group related declarations: type, constructor, methods together
- Order: package doc, imports, constants, types, constructors, methods, helpers
- One primary type per file when it has significant methods
- Dot imports pollute the namespace and make it impossible to tell where a name comes from — never use in library code
Derived from the skill's own SKILL.md documentation · extracted 2026-07-23
golang-code-style FAQ
What does the golang-code-style skill do?
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill). Functions SHOULD be short and focused — one function, one job. Functions SHOULD have ≤4 parameters. Beyond that, use an options struct (see samber/cc-skills-golang@golang-design-patterns skill).
How do I install golang-code-style?
Run: npx -y skills add https://github.com/samber/cc-skills-golang --skill golang-code-style --agent claude-code — the source lives at github.com/samber/cc-skills-golang.
Maintain golang-code-style?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[](https://getagentictools.com/skills/samber-cc-skills-golang-golang-code-style?ref=badge) npx agentictools info skills/samber-cc-skills-golang-golang-code-style The second line is the CLI lookup for this page — handy in READMEs and docs.