go

Develops, tests, reviews, and profiles Go code using the standard toolchain and modern idioms.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill go-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/go
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill go-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct, idiomatic Go requires juggling concurrency lifetimes, error-wrapping chains, version-gated standard library APIs, and testing traps that silently produce flaky or leaking code. This Skill encodes those rules and workflows so an agent produces Go that passes go vet, the race detector, and code review on the first pass. ## Core Features & Use Cases - Opinionated core rules: 22 adjudicated rules covering goroutine lifetimes, channel ownership, errgroup, %w wrapping with errors.Is/errors.AsType, zero-value design, and package layout, each gated on the go directive in go.mod. - Six task workflows: implement, add-tests, fix-race-or-leak, profile-hot-path, upgrade-modules, and review, each ending in a verifiable gate such as go test -race ./... or a benchstat significance check. - Deep reference material: Topic-routed references on concurrency, errors, testing, performance profiling with pprof and runtime/trace, modern standard library APIs (slices, maps, iter, math/rand/v2, log/slog), and modules and workspaces. - Use Case: Ask the agent to review a download-path file; it flags the concurrent map writes as a data race, the never-closed channel as a goroutine leak, replaces the hand-rolled worker pool with errgroup.WithContext plus g.SetLimit, and names goleak as the regression guard. ## Quick Start Ask the agent to review or write Go code in this project, for example: review fetcher.go for races, leaks, and missing timeouts and show the corrected code.

Frequently Asked Questions about go

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix goroutine leaks in Go code?

Give every goroutine a visible exit through a context, a closed channel, or a bounded loop, and make sure the caller can wait for it. Detect leaks with go.uber.org/goleak in tests, the goroutine pprof endpoint in live processes, or the goroutineleak profile on Go 1.27+.

How do I check wrapped errors in Go?

Use errors.Is for sentinel errors and errors.AsType[T] on Go 1.26+ (or errors.As below that) instead of err == ErrX or a type assertion. Direct comparison and assertion stop matching silently as soon as any layer wraps the error with %w.

Should I use errgroup or sync.WaitGroup in Go?

Use errgroup.WithContext when work can fail: it returns the first error, cancels sibling goroutines, and caps concurrency with g.SetLimit. Use sync.WaitGroup (wg.Go on Go 1.25+) only when nothing can fail and nothing needs cancelling.

Does the go skill cover web frameworks like Gin or Echo?

No. Web frameworks and ORMs are out of scope by design; the skill covers only the standard library net/http and database/sql guidance, including ServeMux routing since Go 1.22, server timeouts, and graceful shutdown.

Why does my Go test fail intermittently with t.Parallel?

A parent test function returns before its t.Parallel subtests run, so a defer in the parent fires first and can delete shared state. Register cleanup with t.Cleanup or t.TempDir, give each subtest its own state, and verify with go test -race.

How do I know which Go version features I can use?

Read the go directive in go.mod before proposing anything version-gated; every feature in the skill carries a (Go 1.x+) availability marker. On Go 1.27, go test runs the stdversion vet check that reports standard-library symbols newer than the declared version.