golang

Review Go code for idiomatic patterns, concurrency fixes, and test suggestions.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/jacexh/skills --skill golang-jacexh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang
Source: https://github.com/jacexh/skills/tree/main/skills/golang
Command: npx skills add https://github.com/jacexh/skills --skill golang-jacexh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces bugs, goroutine leaks, and unidiomatic code by providing actionable guidance on Go idioms, safe concurrency, and structured error handling so teams can ship robust backend services.

Core Features & Use Cases

  • Idiomatic patterns: naming, small interfaces, composition over inheritance, happy-path left alignment.
  • Safe concurrency: goroutine lifecycle management, context cancellation, channel patterns, worker pools, and race detector guidance.
  • Error handling & testing: error wrapping with %w, sentinel vs custom errors, table-driven tests, and test helpers using t.Helper().
  • Quality and CI: golangci-lint recommendations, structured logging, profiling, and test coverage workflows.
  • Use Case: Review a Go HTTP API package to remove goroutine leaks, enforce error-wrapping, add table-driven tests, and produce CI lint/test steps.

Quick Start

Ask the golang skill to review a Go package and produce idiomatic refactors, concurrency fixes, and test suggestions.

Frequently Asked Questions about golang

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

FAQPage Schema
How do I fix goroutine leaks and unsafe concurrency in Go backend services?

Fix goroutine leaks in Go backend services by enforcing goroutine lifecycle management, context cancellation, and channel patterns. Use the race detector and worker pools to ensure safe concurrency and prevent leaks.

What is the best way to structure error handling and wrapping in Golang?

The best way to structure error handling in Golang is to enforce error wrapping with %w, distinguish between sentinel and custom errors, and keep happy-path code left-aligned for idiomatic readability.

How do I write table-driven tests for a Go HTTP API package?

Write table-driven tests for a Go HTTP API package by defining test cases in structs, iterating over them, and using test helpers with t.Helper() to produce reliable, CI-ready test coverage.

How do I configure golangci-lint for CI readiness and project quality?

Configure golangci-lint for CI readiness by applying recommended linters, structured logging, and profiling workflows to enforce code quality and catch unidiomatic patterns during continuous integration.

Does this approach work for refactoring CLI tools and system programs?

Yes, this approach works for refactoring CLI tools and system programs by providing idiomatic Go patterns, small interfaces, and composition over inheritance to improve code review and profiling outcomes.