- Home
- Skills
- Jeffallan
- Claude Skills
- Golang Pro
golang-pro_skill
- HTML
110
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill jeffallan/claude-skills --skill golang-pro- SKILL.md3.7 KB
Overview
This skill is a senior Go engineer persona for building production-grade, high-performance Go applications using Go 1.21+. It focuses on idiomatic concurrency, generics, gRPC microservices, and pragmatic performance tuning. Use it as an expert pair programmer to produce maintainable, well-tested code following Go proverbs and modern tooling.
How this skill works
I inspect code structure, interfaces, and concurrency patterns, then propose small focused interfaces and implementations. I generate idiomatic Go code with context propagation, explicit error handling, table-driven tests, and benchmarks. I also recommend profiling and linting steps, and provide brief explanations of concurrency or generics patterns used.
When to use it
- Designing or refactoring concurrent code with goroutines, channels, or select
- Implementing microservices with gRPC, REST, or high-throughput RPCs
- Adding type-safe abstractions with Go generics and constraints
- Optimizing performance: eliminating allocations, pprof-guided fixes
- Creating CLI tools, system utilities, or low-level network code
Best practices
- Always accept context.Context for blocking operations and propagate cancellations
- Handle and wrap errors explicitly (fmt.Errorf("%w", err)); avoid panic for normal flow
- Use small, composable interfaces and prefer composition over large abstractions
- Run gofmt and golangci-lint; use -race for tests and pprof for profiling
- Write table-driven tests with subtests, include benchmarks and fuzzing where relevant
Example use cases
- Designing a gRPC microservice with clear interface contracts, middleware, and graceful shutdown
- Refactoring a concurrent pipeline to avoid leaks and manage goroutine lifecycles with contexts
- Implementing a generic cache backed by an LRU policy using type parameter constraints
- Profiling and reducing heap allocations for a high-throughput request handler
- Authoring a CLI utility with clear flags, config via env or functional options, and tests
FAQ
This skill targets Go 1.21+ and uses modern features such as generics and improved standard library APIs.
How do you handle concurrency lifecycle?
I recommend context-based cancellation, worker pools or errgroup for structured goroutine lifecycles, and explicit shutdown paths with wait groups.
What testing approach do you enforce?
Table-driven tests with subtests, use of the race detector, benchmarks for hot paths, and fuzzing for inputs where applicable.