Skip to content
Back to skills

Errors

ASecurity

Go error handling patterns. Routes to specific patterns.

  • 3 stars
  • 0 votes
  • 0 copies
  • 15 views
  • Added February 7, 2026
developmentgo

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add JamesPrial/claudefiles --skill errors --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Errors?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Errors
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jamesprial-errors/badge)](https://www.skillsdirectory.com/skills/jamesprial-errors)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: go-errors
description: Go error handling patterns. Routes to specific patterns.
---

# Go Error Handling

## Route by Need
- Wrapping errors with context → see [wrapping/](wrapping/)
- Defining sentinel errors → see [sentinel/](sentinel/)
- Checking error types → see [checking/](checking/)

## Quick Check
- [ ] Never ignore errors (_ = fn())
- [ ] Wrap with context at boundaries
- [ ] Use errors.Is/As, not ==

## Common Pattern
```go
func ProcessFile(path string) error {
    f, err := os.Open(path)
    if err != nil {
        return fmt.Errorf("open %s: %w", path, err)
    }
    defer f.Close()

    if err := parse(f); err != nil {
        return fmt.Errorf("parse %s: %w", path, err)
    }
    return nil
}
```

## Resources
- [wrapping/](wrapping/) - Add context with fmt.Errorf %w
- [sentinel/](sentinel/) - Define package-level errors
- [checking/](checking/) - Type-safe error inspection

Files in this skill

  • SKILL.md917 B
  • checking/SKILL.md1.6 KB
  • sentinel/SKILL.md1.2 KB
  • wrapping/SKILL.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.