
Golang Patterns
This one's a solid reference for writing Go the way the language designers intended. It covers the fundamentals like making zero values useful, accepting interfaces but returning structs, and proper error wrapping with fmt.Errorf. The concurrency section is especially practical, showing worker pools, errgroup usage, and how to avoid goroutine leaks with buffered channels and context. What I like is it doesn't just tell you the rules, it shows bad examples alongside good ones so you can see why idiomatic Go matters. Activate this when you're writing new Go code or reviewing pull requests and want to keep things simple and maintainable instead of clever.
- skills.sh installs
- 6.3K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --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/ecc
- Category
- Go
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Postgres Patterns6.3K
- Verification Loop6.3K
- Article Writing6.3K
- Django Patterns6.2K
- Cpp Coding Standards6.2K
- Golang Testing6.2K
- Deep Research6.2K
- Java Coding Standards6.2K
- Blender Motion State Inspection6.1K
- Laravel Patterns6.1K
- Rust Patterns6.1K
- Springboot Patterns6.1K
- Context Budget6.1K
- Accessibility6.1K
- Nestjs Patterns6.1K
- Seo6.1K
- Django Security6.1K
- Git Workflow6K
- Python Testing6K
- Strategic Compact6K
- Design System6K
- Browser Qa6K
- Springboot Security6K
- Search First6K