Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides idiomatic Go error handling, wrapping, inspection, and structured logging across codebases.
73% 100%+27 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 16 of 22 without it.
3 of 3 safety checks passed
123 agent runs
2 forksA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
Go treats errors as ordinary values implementing the error interface:
type error interface {
Error() string
}
This means errors are returned, not thrown. Every function that can fail returns an error as its last return value, and every caller must check it.
// ✗ Bad — silently discarding errors
data, _ := os.ReadFile("config.yaml")
// ✗ Bad — only checking in some branches
result, err := doSomething()
fmt.Println(result) // using result without checking err
// ✓ Good — always check before using other return values
data, err := os.ReadFile("config.yaml")
if err != nil {
return fmt.Errorf("reading config: %w", err)
}
Error strings MUST be lowercase, without trailing punctuation, and should not duplicate the context that wrapping will add.
// ✗ Bad — capitalized, punctuation, redundant prefix
return errors.New("Failed to connect to database.")
return fmt.Errorf("UserService: failed to fetch user: %w", err)
// ✓ Good — lowercase, no punctuation, concise
return errors.New("connection refused")
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.