Go Functions
Go function design rules covering file ordering, signature wrapping, interface parameters, and Printf-style naming.
- CCM score
- 65 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 197
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers function grouping and ordering in Go files: call order, receiver grouping, exported-first, and constructors placed after their types
- Includes signature formatting rules for wrapped parameter lists,
/* name */comments for ambiguous arguments, and custom types in place of naked bools - Enforces passing interfaces by value rather than as pointers, and
f-suffixed names for Printf-style functions to supportgo vet - Designed for Go developers writing or refactoring functions, with routing to related skills for error returns, naming, and functional options
Install
$ npx -y skills add cxuu/golang-skills --skill go-functions -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Go Function Design
Resource Routing
references/SIGNATURES.md- Read when designing parameters, return values, named results, or signature readability.references/PRINTF-STRINGER.md- Read when using fmt verbs, Stringer, GoStringer, Formatter, or Printf-style function naming.
When this skill does NOT apply: For functional options constructors (
WithTimeout,WithLogger), see go-functional-options. For error return conventions, see go-error-handling. For naming functions and methods, see go-naming.
Function Grouping and Ordering
Organize functions in a file by these rules:
- Functions sorted in rough call order
- Functions grouped by receiver
- Exported functions appear first, after
struct/const/vardefinitions NewXxx/newXxxconstructors appear right after the type definition- Plain utility functions appear toward the end of the file
type something struct{ ... }
func newSomething() *something { return &something{} }
func (s *something) Cost() int { return calcCost(s.weights) }
func (s *something) Stop() { ... }
Details
- Repository
- github.com/cxuu/golang-skills
- Category
- Go
- First seen
- Jun 3, 2026
More from cxuu/golang-skills
All 20- Go Declarations1.1K
- Go Code Review1.9K
- Go Testing1.5K
- Go Error Handling1.4K
- Go Concurrency1.4K
- Go Interfaces1.4K
- Go Linting1.4K
- Go Style Core1.4K
- Go Documentation1.4K
- Go Context1.4K
- Go Performance1.4K
- Go Naming1.4K
- Go Defensive1.4K
- Go Packages1.3K
- Go Functional Options1.3K
- Go Data Structures1.3K
- Go Control Flow1.3K
- Go Logging1.2K
- Go Generics1.1K
Similar to Go Functions
More Gogo-documentationcxuu/golang-skills1.4K installsStructured guide for writing Go doc comments, with a validation script for exported symbols and package comments.
go-style-corecxuu/golang-skills1.4K installsCore Go style guidance covering clarity-first priorities, gofmt, early returns, and semicolon rules.
golang-structs-interfacessamber/cc-skills-golang42.6K installsGo struct and interface design guide covering composition, embedding, type assertions, and pointer vs value receivers.
golang-design-patternssamber/cc-skills-golang45.3K installsIdiomatic Go design patterns covering constructors, error flow, lifecycle, and architecture choices for production code.
go-code-reviewexistential-birds/beagle206 installsStructured Go review skill that checks idiomatic patterns, error handling, concurrency safety, and version-gated advice from go.mod.