LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

golang-code-style

Golang code style, formatting and conventions. Use when writing Go code, reviewing style, configuring linters, writing comments, or establishing project standards.

1,701stars108forksUpdated 5/16/2026
Code Review#go#software-engineering#golang#code-style#linting#code-review

Security Assessment

Safe(100/100)
Security Score100/100

About golang-code-style

This skill defines Go (Golang) coding style conventions focused on readability, clarity, and maintainable code structure. It addresses the problem of inconsistent code patterns across teams and AI-generated code, where different formatting or structural decisions can reduce readability and increase cognitive load during reviews. Instead of focusing on mechanical formatting (typically handled by tools like linters and gofmt), it establishes higher-level guidance for how Go code should be written to remain clear and idiomatic. The core principle is prioritizing explicit, intention-revealing code over clever or compact constructs.

Key capabilities include guidance on line breaking rules for long expressions, requiring semantic breaks and multi-line formatting for function calls with multiple arguments, as well as recommending design adjustments like option structs when signatures grow too large. It also defines variable declaration semantics, distinguishing between zero-value initialization using 'var' and intentional initialization using ':='. It enforces explicit initialization of slices and maps to avoid nil-related runtime issues and JSON surprises. Composite literals must use named fields to preserve forward compatibility. Control flow guidance emphasizes early returns to reduce nesting and discourages unnecessary 'else' blocks. It also encourages default-then-override patterns for clarity, along with consistent commenting when rules are intentionally ignored.

This skill is intended for Go developers, technical teams, and AI coding agents that generate or review Go code. It is particularly useful in code review workflows, backend service development, and projects requiring consistent engineering standards across multiple contributors. It helps maintain readability in large codebases, reduces common pitfalls in Go such as nil maps or overly complex function signatures, and supports establishing shared conventions in engineering organizations. It is designed to complement other Go-focused skills such as naming, design patterns, and struct/interface design guidance.

FAQ

When should I use 'var' instead of ':=' in Go code?

'var' is preferred when you want to explicitly initialize a variable to its zero value, signaling that it will be assigned later or intentionally starts empty. ':=' is used when assigning a meaningful non-zero value at declaration time. This distinction helps communicate intent clearly.

Does this skill replace Go linters or formatting tools?

No. Linters and formatting tools handle mechanical concerns like syntax formatting. This skill focuses on higher-level readability decisions, such as structure, clarity, naming intent, and control flow patterns.

How should long function calls or lines be handled?

Lines longer than roughly 120 characters should be broken at semantic boundaries. For function calls with multiple arguments, each argument should be placed on its own line. If a function signature becomes too large, refactoring into an options structure is preferred over excessive wrapping.

Can rules be ignored if necessary?

Yes, but any deviation should be explicitly documented with a comment in the code explaining why the rule is being ignored to preserve clarity for future readers.

All Files

3 files
SKILL.md8.6 KB
View
evals/evals.json34.9 KB
View
references/details.md2.6 KB
View

Install golang-code-style

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

samber/cc-skills-golang

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901