golang-pro

Develop production-grade Go services with concurrency, generics, and testing.

905|126|Updated Jan 27, 2023
One-click install
npx skills add https://github.com/carrot-hu23/dst-admin-go --skill golang-pro-carrot-hu23
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-pro
Source: https://github.com/carrot-hu23/dst-admin-go/tree/main/.claude/skills/golang-pro
Command: npx skills add https://github.com/carrot-hu23/dst-admin-go --skill golang-pro-carrot-hu23

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Many Go projects struggle with correct concurrency patterns, lifecycle management of goroutines, efficient use of generics, and production-grade practices such as context propagation, profiling, and robust testing, which leads to subtle bugs and poor performance in microservices and system utilities.

Core Features & Use Cases

  • Concurrency & Lifecycle: Guidance on goroutine management, worker pools, fan-out/fan-in, select patterns, and graceful shutdown.
  • Microservices & gRPC: Best practices for building gRPC microservices, API boundaries, and module layout for cloud-native deployment.
  • Generics & Interfaces: Patterns for type-safe generics, union constraints, small composable interfaces, and dependency injection via interfaces.
  • Performance & Testing: Recommendations for pprof profiling, benchmarks, race detector usage, table-driven tests, and fuzzing.
  • Use Case: Refactor a Go service to eliminate data races, add benchmarks and coverage, and convert brittle code to idiomatic, testable modules.

Quick Start

Use golang-pro to review a Go package, fix context propagation and goroutine lifecycle issues, add table-driven tests and benchmarks, and produce a short plan for profiling and optimizing hotspots.

Frequently Asked Questions about golang-pro

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

FAQPage Schema
How do I fix data races and manage goroutine lifecycles in Go microservices?

To fix data races in Go microservices, implement proper goroutine lifecycle management using context propagation and graceful shutdown patterns. This ensures worker pools and fan-out/fan-in operations terminate cleanly without leaking resources, eliminating subtle concurrency bugs.

How do I build production-grade gRPC APIs with Go 1.21+?

Building production-grade gRPC APIs with Go 1.21+ requires defining clear API boundaries, structuring modules for cloud-native deployment, and applying idiomatic error handling. This approach ensures robust microservices that handle network failures and context cancellation predictably.

What is the best way to use generics and type-safe constraints in Go?

The best way to use generics in Go is applying type-safe patterns with union constraints and small composable interfaces. This enables flexible dependency injection via interfaces while maintaining strict type safety across your performance-critical modules.

How do I profile Go performance hotspots and add race detection to tests?

To profile Go performance hotspots, use pprof profiling alongside table-driven tests and benchmarks. You must enable the race detector during testing and implement fuzzing to uncover hidden concurrency issues and optimize critical code paths systematically.

Does this approach work for refactoring brittle Go code into testable modules?

Yes, this approach works for refactoring brittle Go code into testable modules by converting existing logic to idiomatic patterns. It eliminates context propagation issues, adds comprehensive benchmark coverage, and ensures race-free concurrent execution.