
Go Style Core
This is your baseline for Go formatting and readability. It covers gofmt defaults, reducing nesting through early returns, when naked returns are acceptable (short functions only), and why opening braces stay on the same line due to semicolon insertion. The priority order matters here: clarity beats simplicity beats concision, which is a useful tiebreaker when you're staring at two valid approaches. It explicitly punts on naming, error handling, and testing to other skills, so think of this as the fallback when you have a style question that doesn't fit elsewhere. The examples are practical, especially the nested loop refactoring that shows how continue keeps code flat.
- skills.sh installs
- 1.3K
- GitHub stars
- 193
- last updated
- Aug 21, 2026
Install
$ npx -y skills add cxuu/golang-skills --skill go-style-core --agent claude-codeInstalls into .claude/skills of the current project.
Files
Go Style Core Principles
Resource Routing
references/PRINCIPLES.md- Read when resolving conflicts between clarity, simplicity, concision, maintainability, and consistency.references/FORMATTING.md- Read when handling gofmt, line breaks, whitespace, comments, or semicolons.
Style Principles (Priority Order)
When writing readable Go code, apply these principles in order of importance:
Priority Order
- Clarity — Can a reader understand the code without extra context?
- Simplicity — Is this the simplest way to accomplish the goal?
- Concision — Does every line earn its place?
- Maintainability — Will this be easy to modify later?
- Consistency — Does it match surrounding code and project conventions?
Formatting
Run gofmt — no exceptions. There is no rigid line length limit, but Uber suggests a soft limit of 99 characters. Break by semantics, not length — refactor rather than just wrap.
Reduce Nesting
Handle error cases and special conditions first. Return early or continue the loop to keep the "happy path" unindented.
Sponsors
Details
- Repository
- github.com/cxuu/golang-skills
- Categories
- Testing & QA, Code Review & Quality, Debugging, Go
- First seen
- May 16, 2026
More from cxuu/golang-skills
All 20- Go Performance1.3K
- Go Context1.3K
- Go Naming1.3K
- Go Defensive1.3K
- Go Packages1.3K
- Go Data Structures1.3K
- Go Functional Options1.3K
- Go Control Flow1.3K
- Go Logging1.1K
- Go Functions1.1K
- Go Generics1.1K
- Go Declarations1.1K
- Go Code Review1.8K
- Go Testing1.4K
- Go Error Handling1.3K
- Go Linting1.3K
- Go Concurrency1.3K
- Go Interfaces1.3K
- Go Documentation1.3K