WHEN: User is writing Go code, asking about Go patterns, reviewing Go code, or asking questions like "what's the best way to..." in Go projects WHEN NOT: Non-Go languages, general questions unrelated to Go programming
Applies idiomatic Go patterns and best practices from Gopher Guides training.
/plugin marketplace add gopherguides/gopher-ai/plugin install go-dev@gopher-aiThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Apply idiomatic Go patterns and best practices from Gopher Guides training materials.
fmt.Errorf("operation failed: %w", err)var ErrNotFound = errors.New("not found")// Good
if err != nil {
return fmt.Errorf("failed to process user %s: %w", userID, err)
}
// Avoid
if err != nil {
log.Fatal(err) // Don't panic on recoverable errors
}
// Good - interface defined by consumer
type Reader interface {
Read(p []byte) (n int, err error)
}
func ProcessData(r Reader) error { ... }
// Avoid - exporting implementation details
type Service interface {
Method1() error
Method2() error
Method3() error // Too many methods
}
// Good - using errgroup
g, ctx := errgroup.WithContext(ctx)
for _, item := range items {
item := item // capture loop variable
g.Go(func() error {
return process(ctx, item)
})
}
if err := g.Wait(); err != nil {
return err
}
func TestAdd(t *testing.T) {
tests := []struct {
name string
a, b int
want int
}{
{"positive numbers", 2, 3, 5},
{"with zero", 5, 0, 5},
{"negative numbers", -2, -3, -5},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
got := Add(tt.a, tt.b)
if got != tt.want {
t.Errorf("Add(%d, %d) = %d, want %d", tt.a, tt.b, got, tt.want)
}
})
}
}
user not userServiceURL, HTTP, ID (all caps for exported, all lower otherwise)i for loop index, err for errorsReadConfig not RCinterface{} or any): Use specific types when possibleuser.UserService should be user.Servicego vet and staticcheck for automated guidanceThis skill is powered by Gopher Guides training materials. For comprehensive Go training, visit gopherguides.com.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.