go-coding-standards

Defines idiomatic Go coding standards covering error handling, concurrency, testing, and linting.

4|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/minexo79/coser-card-maker --skill go-coding-standards-minexo79
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-coding-standards
Source: https://github.com/minexo79/coser-card-maker/tree/main/.kilo/skills/coding-standards/go
Command: npx skills add https://github.com/minexo79/coser-card-maker --skill go-coding-standards-minexo79

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Go developers often write inconsistent, non-idiomatic code with poor error handling, weak test coverage, and unenforced style rules, leading to bugs and maintenance burden in production services. ## Core Features & Use Cases - Idiomatic Style Guide: Enforces Go naming conventions, package structure (cmd/internal/pkg layout), gofmt/goimports formatting, and interface-based design. - Error Handling & Concurrency Patterns: Provides sentinel errors, error wrapping with context, worker pools, and context-based cancellation patterns. - Testing & Tooling Standards: Includes table-driven test templates, benchmark guidance, and a ready-to-use .golangci.yml linter configuration. - Use Case: When starting a new Go microservice, apply this skill to scaffold the project structure, configure golangci-lint, and write table-driven tests with proper error wrapping from day one. ## Quick Start Ask the AI to review your Go service code against idiomatic Go standards and generate a golangci-lint configuration with table-driven tests.

Frequently Asked Questions about go-coding-standards

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

FAQPage Schema
How do I structure a Go project following best practices?

Use the standard layout with cmd/ for entry points, internal/ for private domain packages like auth and user, and pkg/ for reusable components. Initialize with go mod init and keep dependencies tidy with go mod tidy.

How to handle errors idiomatically in Go?

Return errors explicitly and wrap them with context using fmt.Errorf and the %w verb. Define sentinel errors with errors.New, then check them with errors.Is and extract custom error types with errors.As.

What linters should I enable in golangci-lint for Go?

Enable gofmt, goimports, govet, errcheck, staticcheck, unused, gosec, ineffassign, misspell, and revive. The provided .golangci.yml configures these with shadow checking, medium gosec severity, and a five-minute run timeout.

How do I write table-driven tests in Go?

Define a slice of anonymous structs holding test name, inputs, and expected output, then loop over them calling t.Run for each case. This pattern scales well and integrates with go test -cover and -bench flags.

When should I use goroutines and channels versus sync primitives?

Use goroutines with channels for worker pools and pipelines where data flows between stages. Use sync.WaitGroup to coordinate completion and sync.Pool to reuse buffers, and always propagate cancellation via context.Context.