
Golang Patterns
A comprehensive reference for idiomatic Go development that covers the language's core philosophy and practical patterns. It emphasizes Go's fundamental principles like making zero values useful, accepting interfaces while returning structs, and proper error wrapping with context. The concurrency section is especially solid, covering worker pools, errgroup coordination, and goroutine leak prevention. What I appreciate most is how it consistently shows both good and bad examples, making the reasoning clear. The interface design guidance around defining interfaces at the point of use rather than with the implementation is spot on and often overlooked by developers coming from other languages.
- skills.sh installs
- 9.9K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill golang-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Go Development Patterns
Idiomatic Go patterns and best practices for building robust, efficient, and maintainable applications.
When to Activate
- Writing new Go code
- Reviewing Go code
- Refactoring existing Go code
- Designing Go packages/modules
Core Principles
1. Simplicity and Clarity
Go favors simplicity over cleverness. Code should be obvious and easy to read.
// Good: Clear and direct
func GetUser(id string) (*User, error) {
user, err := db.FindUser(id)
if err != nil {
return nil, fmt.Errorf("get user %s: %w", id, err)
}
return user, nil
}
// Bad: Overly clever
func GetUser(id string) (*User, error) {
return func() (*User, error) {
if u, e := db.FindUser(id); e == nil {
return u, nil
} else {
return nil, e
}
}()
}
2. Make the Zero Value Useful
Design types so their zero value is immediately usable without initialization.
// Good: Zero value is useful
type Counter struct {
mu sync.Mutex
count int // zero value is 0, ready to use
}
func (c *Counter) Inc() {
c.mu.Lock()
c.count++
c.mu.Unlock()
}
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- Category
- Go
More from affaan-m/everything-claude-code
All 256- Backend Patterns8.7K
- Coding Standards8.7K
- Frontend Patterns8.6K
- Golang Testing8.4K
- Springboot Patterns7.7K
- Continuous Learning V27.5K
- Postgres Patterns7.1K
- Django Patterns7K
- Frontend Slides7K
- Python Patterns7K
- Api Design6.9K
- Tdd Workflow6.9K
- Docker Patterns6.8K
- Java Coding Standards6.6K
- Python Testing6.6K
- Video Editing6.6K
- Django Security6.5K
- Springboot Security6.4K
- Article Writing6.3K
- Prompt Optimizer6.3K
- Cpp Coding Standards6.2K
- Market Research6.2K
- Strategic Compact6.1K
- Android Clean Architecture6K