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-code

Installs 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

Recommended

More Go
1affaan-m avatargolang-patternsaffaan-m/eccIdiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.6.3Kskills.sh installs
2manutej avatargolang-backend-developmentmanutej/luxor-claude-marketplaceComplete guide for Go backend development including concurrency patterns, web servers, database integration, microservices, and production deployment1.4Kskills.sh installs
3mindrally avatargo-backend-microservicesmindrally/skillsGo backend development best practices for microservices with clean architecture, observability, and production-ready patterns855skills.sh installs
4sickn33 avatargolang-prosickn33/antigravity-awesome-skillsgolang pro455skills.sh installs
5bobmatnyc avatargolang-concurrency-patternsbobmatnyc/claude-mpm-skillsGo concurrency patterns for production services: context cancellation, errgroup, worker pools, bounded parallelism, fan-in/fan-out, and common race/deadlock pit420skills.sh installs
6sickn33 avatargo-concurrency-patternssickn33/antigravity-awesome-skillsgo concurrency patterns263skills.sh installs