golang-idioms

Idiomatic Go patterns for error handling, interfaces, concurrency, testing, and module management

Content Preview
---
name: golang-idioms
description: Idiomatic Go patterns for error handling, interfaces, concurrency, testing, and module management
---

# Go Idioms

## Error Handling

```go
// Return errors, never panic in library code
func LoadConfig(path string) (Config, error) {
    data, err := os.ReadFile(path)
    if err != nil {
        return Config{}, fmt.Errorf("reading config %s: %w", path, err)
    }

    var cfg Config
    if err := json.Unmarshal(data, &cfg); err != nil {
        return Config
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/golang-idioms.md \
  https://raw.githubusercontent.com/rohitg00/awesome-claude-code-toolkit/main/skills/golang-idioms/SKILL.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/rohitg00/awesome-claude-code-toolkit

Then reference at skills/golang-idioms/SKILL.md

Related Skills