Back to skills
SKILL.md
Errors
ASecurityGo error handling patterns. Routes to specific patterns.
- 3 stars
- 0 votes
- 0 copies
- 2 views
- Added February 7, 2026
Security analysis
100/100Pro scans all 4 files and shows the line behind each finding
npx -y skills add JamesPrial/claudefiles --skill errors --agent claude-codeAre you the author of Errors?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/jamesprial-errors)---
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.md
- checking/SKILL.md
- sentinel/SKILL.md
- wrapping/SKILL.md
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.