dev-golang

Implements idiomatic Go code with goroutines, generics, gRPC microservices, and table-driven tests.

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/Choi-Keith/skill-arsenal-ultra --skill dev-golang-choi-keith
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dev-golang
Source: https://github.com/Choi-Keith/skill-arsenal-ultra/tree/main/plugins/dev-skills/dev-backend/skills/dev-golang
Command: npx skills add https://github.com/Choi-Keith/skill-arsenal-ultra --skill dev-golang-choi-keith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing production-grade Go requires deep knowledge of concurrency patterns, interface design, generics, and testing conventions that general-purpose AI often gets wrong, leading to goroutine leaks, ignored errors, and non-idiomatic code. ## Core Features & Use Cases - Concurrency Patterns: Implements worker pools, fan-out/fan-in, pipelines, rate limiters, and semaphores with proper context cancellation and no goroutine leaks. - Idiomatic Go Design: Enforces small composable interfaces, functional options, error wrapping with %w, and Go 1.18+ generics with union constraints. - DDD Project Structure: Provides a full domain-driven design layout (domain/application/adapter/infra) with naming conventions, dependency injection, and fixed import aliases. - Testing & Quality: Mandates table-driven tests, fuzzing, benchmarks, race detector runs, and golangci-lint validation before completion. - Use Case: Ask the agent to build a gRPC user service; it produces the domain entity, repository interface, application service, HTTP/gRPC handlers, and table-driven tests following the DDD layout with swagger-annotated response structs. ## Quick Start Ask the agent to implement a Go microservice with a worker pool, repository layer, and table-driven tests following the project's DDD structure.

Frequently Asked Questions about dev-golang

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

FAQPage Schema
How do I implement a worker pool with goroutines in Go?

Create a buffered task channel, spawn a fixed number of worker goroutines that range over the channel, and use sync.WaitGroup to wait for completion. Close the channel to signal shutdown and always propagate context for cancellation.

How to write table-driven tests in Go?

Define a slice of anonymous structs holding test name, inputs, and expected outputs, then loop over them calling t.Run for each case. Add t.Parallel for parallel subtests and run with the -race flag to detect data races.

What project structure should a Go microservice use?

Use a DDD layout with cmd/ for entry points and internal/ split into domain, application, adapter, and infra layers. The domain layer holds entities and repository interfaces with zero third-party dependencies, while implementations live in infra.

Does Go generics support union type constraints?

Yes, Go 1.18+ supports union constraints using the pipe syntax such as int | string inside an interface constraint. Use the tilde prefix like ~int to also match named types whose underlying type is int.

Why does my Go program leak goroutines?

Goroutine leaks happen when goroutines block forever on channels with no sender or lack cancellation handling. Always pass context.Context, select on ctx.Done(), and ensure every goroutine has a defined lifecycle and exit path.

When should I avoid using reflection in Go?

Avoid reflection unless there is a clear performance-justified reason, since it bypasses compile-time type safety and hurts readability. Prefer generics, interfaces, or code generation for type-flexible logic.