Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Gives Go efficiency guidelines on error handling, slices, maps, goroutines, channels, structs, interfaces, functions, and anti-patterns.
92% 96%+4 ptsof test cases passed
Passed 23 of 24 test cases with the skill, and 22 of 24 without it.
3 of 3 safety checks passed
20 agent runs
1 forkA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
// ❌ Ignoring errors
result, _ := os.Open(path)
// ✅ — always handle; only use _ when error is provably irrelevant
result, err := os.Open(path)
if err != nil {
return fmt.Errorf("open %s: %w", path, err)
}
// ❌ Redundant error variable
err := doA()
if err != nil { return err }
err = doB()
if err != nil { return err }
// ✅ — each :=/: is fine; this is idiomatic Go. Don't try to "fix" it.
// What you CAN simplify: collapsing to one-liners where the if body is a single return
if err := doA(); err != nil { return err }
if err := doB(); err != nil { return err }
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.