Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/eroslifestyle-go-patterns-9ea89b
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/go-patterns
What's inside
- Skill name
go-patterns- Description
- Go best practices, idioms, and patterns. Auto-activated when working with .go files. Covers error handling, concurrency, interfaces, testing.
- License
- MIT
- Instructions
- 271 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Go Patterns & Best Practices
> **Detailed patterns:** See `rules/go/patterns.md` for comprehensive examples.
## Error Handling
- **Always** check returned errors -- never discard with `_`
- Wrap errors with context: `fmt.Errorf("doing X: %w", err)`
- Use `errors.Is` / `errors.As` for comparison (works through wrapping)
- Define sentinel errors for expected, recoverable cases
```go
var ErrNotFound = errors.New("not found")
func GetUser(ctx context.Context, id string) (*User, error) {
if err := row.Scan(&u.ID, &u.Name); err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, fmt.Errorf("get user %s: %w", id, ErrNotFound)
}
return nil, fmt.Errorf("get user %s: %w", id, err)
}
return &u, nil
}
// Caller checks with errors.Is
if errors.Is(err, ErrNotFound) { http.Error(w, "Not found", 404) }
```
### Custom Error Types
```go
type ValidationError struct { Field, Message string }
func (e *ValidationError) Error() string {
return fmt.Sprintf("validation error on %s: %s", e.Field, e.Message)
}
// Check with errors.As
var valErr *ValidationError
if errors.As(err, &valErr) { /* handle */ }
```
## Interfaces
- Define interfaces **at the consumer site**, not the producer
- Keep interfaces small: 1-3 methods (single responsibility)
- **Accept interfaces, return structs**
```go
// WRONG - large interface at producer
type UserService interface {
GetUser(ctx context.Context, id string) (*User, error)
CreateUser(ctx context.Context, u *User) error
// ... more methods
}
// CORRECT - small interface at consumer
type UserGetter interface {
GetUser(ctx context.Context, id string) (*User, error)
}
func NewHandler(users UserGetter) *Handler { return &Handler{users: users} }
```
## Concurrency
### Goroutines + Channels
```go
func processItems(ctx context.Context, items []Item) error {
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(10) // limit concurrent goroutines
for _, item := range items {
g.Go(func() error { return processOne(ctx, item) })
}
return g.Wait()
}
```
### Context for Cancellation
```go
func longOperation(ctx context.Context) error {
for i := range 1000 {
select {
case <-ctx.Done(): return ctx.Err()
default: if err := doStep(i); err != nil { return fmt.Errorf("step %d: %w", i, err) }
}
}
return nil
}
// Caller: ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
```
### Worker Pool
```go
func workerPool(ctx context.Context, jobs <-chan Job, results chan<- Result, workers int) {
var wg sync.WaitGroup
for range workers {
wg.Add(1)
go func() {
defer wg.Done()
for job := range jobs {
select {
case <-ctx.Done(): return
case results <- process(job):
}
}
}()
}
wg.Wait(); close(results)
}
```
## Struct Design
### Functional Options Pattern
```go
type Server struct { addr string; readTimeout time.Duration; logger *slog.Logger }
type Option func(*Server)
func WithReadTimeout(d time.Duration) Option { return func(s *Server) { s.readTimeout = d } }
func WithLogger(l *slog.Logger) Option { return func(s *Server) { s.logger = l } }From eroslifestyle/Claude-Orchestrator-Plugin, MIT.
More from eroslifestyle/Claude-Orchestrator-Plugin
- 0.432score
debugging
eroslifestyle
When to use this skill for systematic debugging including root cause analysis, error tracing, performance profiling, and memory leak detection
SkillDFreshness: D★ 1Claude Code +9 - 0.432score
learn
eroslifestyle
Capture a learning pattern from the current session with confidence scoring.
SkillDFreshness: D★ 1Claude Code +9 - 0.432score
evolve
eroslifestyle
Aggregate high-confidence instincts into reusable skills.
SkillDFreshness: D★ 1Claude Code +9 - 0.431score
git-workflow
eroslifestyle
When to use this skill for advanced Git operations and workflow management
SkillDFreshness: D★ 1Claude Code +9 - 0.431score
code-review
eroslifestyle
When to use this skill for automated code quality analysis and review
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
prompt-engineering-patterns
eroslifestyle
Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
python-patterns
eroslifestyle
Python best practices, idioms, and patterns.
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
plan
eroslifestyle
Decompose a feature request into a detailed implementation plan with task breakdown, dependencies, and risk assessment.
SkillDFreshness: D★ 1Claude Code - 0.426score
checkpoint
eroslifestyle
Save a named checkpoint of current session progress.
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
build-fix
eroslifestyle
Diagnose and fix build errors automatically.
SkillDFreshness: D★ 1Claude Code - 0.426score
refactor-clean
eroslifestyle
Clean up dead code, unused imports, and improve code organization.
SkillDFreshness: D★ 1Claude Code - 0.426score
metrics
eroslifestyle
Display detailed session metrics and agent performance.
SkillDFreshness: D★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 3, 2026 (7 months ago)
- Last release
- Mar 3, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from eroslifestyle
- 0.432score
evolve
eroslifestyle
Aggregate high-confidence instincts into reusable skills.
SkillDFreshness: D★ 1Claude Code +9 - 0.432score
debugging
eroslifestyle
When to use this skill for systematic debugging including root cause analysis, error tracing, performance profiling, and memory leak detection
SkillDFreshness: D★ 1Claude Code +9 - 0.432score
learn
eroslifestyle
Capture a learning pattern from the current session with confidence scoring.
SkillDFreshness: D★ 1Claude Code +9 - 0.431score
git-workflow
eroslifestyle
When to use this skill for advanced Git operations and workflow management
SkillDFreshness: D★ 1Claude Code +9 - 0.431score
code-review
eroslifestyle
When to use this skill for automated code quality analysis and review
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
python-patterns
eroslifestyle
Python best practices, idioms, and patterns.
SkillDFreshness: D★ 1Claude Code +9
Cite this page
go-patterns skill. Agent Mart. https://agentmart.dev/skills/eroslifestyle-go-patterns-9ea89b (last updated 2026-10-24)