golang-patterns
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
Skill by sazardev
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/sazardev-golang-patterns
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
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
golang-patterns- Description
- Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
- License
- MIT
- Instructions
- 670 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Agent Skills spec issues
- body: 670 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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.
```go
// 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.
```go
// 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()
}
// Good: bytes.Buffer works with zero value
var buf bytes.Buffer
buf.WriteString("hello")
// Bad: Requires initialization
type BadCounter struct {
counts map[string]int // nil map will panic
}
```
### 3. Accept Interfaces, Return Structs
Functions should accept interface parameters and return concrete types.
```go
// Good: Accepts interface, returns concrete type
func ProcessData(r io.Reader) (*Result, error) {
data, err := io.ReadAll(r)
if err != nil {
return nil, err
}
return &Result{Data: data}, nil
}
// Bad: Returns interface (hides implementation details unnecessarily)
func ProcessData(r io.Reader) (io.Reader, error) {
// ...
}
```
## Error Handling Patterns
### Error Wrapping with Context
```go
// Good: Wrap errors with context
func LoadConfig(path string) (*Config, error) {
data, err := os.ReadFile(path)
if err != nil {
return nil, fmt.Errorf("load config %s: %w", path, err)
}
var cfg Config
if err := json.Unmarshal(data, &cfg); err != nil {
return nil, fmt.Errorf("parse config %s: %w", path, err)
}
return &cfg, nil
}
```
### Custom Error Types
```go
// Define domain-specific errors
type ValidationError struct {
Field string
Message string
}
func (e *ValidationError) Error() string {
return fmt.Sprintf("validation failed on %s: %s", e.Field, e.Message)
}From sazardev/goca, MIT.
More from sazardev/goca
- 0.683score
ddd-teaching-skill
sazardev
Enseña Domain-Driven Design y Clean Architecture de forma guiada usando Goca CLI.
SkillCFreshness: C★ 304Claude Code +9 - 0.578score
caveman-commit
sazardev
Ultra-compressed commit message generator.
SkillCFreshness: C★ 304Claude Code +9 - 0.578score
caveman
sazardev
Ultra-compressed communication mode.
SkillCFreshness: C★ 304Claude Code +9 - 0.328score
goca-helper-skill
sazardev
No description from the publisher yet.
SkillCFreshness: C★ 304Claude Code +9 - 0.328score
mcp-tools
sazardev
No description from the publisher yet.
SkillCFreshness: C★ 304Claude Code +9 - 0.328score
codegen-testing
sazardev
No description from the publisher yet.
SkillCFreshness: C★ 304Claude Code +9 - 0.328score
goca-architecture
sazardev
No description from the publisher yet.
SkillCFreshness: C★ 304Claude Code +9
Signals
- Stars
- 304
- Forks
- 11
- Open issues
- 0
- Last commit (this folder)
- May 25, 2026 (5 months ago)
- Last release
- Jul 12, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/sazardev/goca
- Website
- sazardev.github.io/goca/
- 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.
- 0.399score
golang-patterns
vibeeval
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
SkillDFreshness: D★ 540Claude Code +9 - 0.301score
golang-patterns
ViewWay
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
SkillCFreshness: C★ 3Claude Code +9 - 0.289score
golang-patterns
Luohaothu
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
SkillDFreshness: D★ 26Claude Code +9 - 0.271score
golang-patterns
chaitin
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
SkillDFreshness: D★ 7Claude Code +9
More from sazardev
- 0.683score
ddd-teaching-skill
sazardev
Enseña Domain-Driven Design y Clean Architecture de forma guiada usando Goca CLI.
SkillCFreshness: C★ 304Claude Code +9 - 0.578score
caveman
sazardev
Ultra-compressed communication mode.
SkillCFreshness: C★ 304Claude Code +9 - 0.578score
caveman-commit
sazardev
Ultra-compressed commit message generator.
SkillCFreshness: C★ 304Claude Code +9
Cite this page
golang-patterns skill. Agent Mart. https://agentmart.dev/skills/sazardev-golang-patterns (last updated 2026-10-24)