skills/smithery.ai/go-best-practices

go-best-practices

SKILL.md

Go Best Practices

Follows type-first, functional, and error handling patterns from CLAUDE.md. This skill covers language-specific idioms only.

Make Illegal States Unrepresentable

Use Go's type system to prevent invalid states at compile time.

Custom types for domain primitives:

// Distinct types prevent mixing up IDs
type UserID string
type OrderID string

func GetUser(id UserID) (*User, error) {
    // Compiler prevents passing OrderID here
}
Installs
18
First Seen
Mar 14, 2026