go-patterns
CommunityWrite idiomatic Go, build high-performance services.
Software Engineering#testing#error handling#interfaces#concurrency#patterns#Go#idioms#system programming#Golang
AuthorZate
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Writing clean, efficient, and concurrent Go code requires adherence to idiomatic patterns and best practices. Without clear guidance, Go projects can suffer from goroutine leaks, race conditions, and poor error handling.
Core Features & Use Cases
- Interface Design: Master small, focused interfaces and the "accept interfaces, return structs" principle.
- Error Handling: Implement robust error wrapping, sentinel errors, and custom error types for clear diagnostics.
- Concurrency Patterns: Safely use goroutines with
WaitGroup, worker pools, andcontextfor cancellation and deadlines. - Testing Patterns: Write effective table-driven tests, test helpers, and interface-based mocking for comprehensive coverage.
- Functional Options: Design configurable constructors for flexible and extensible APIs.
- Use Case: Design a concurrent worker pool, implement robust error handling for an API, or write a table-driven test for a utility function.
Quick Start
Implement a Go function that reads from an io.Reader and returns an error, demonstrating proper error wrapping and context propagation.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: go-patterns Download link: https://github.com/Zate/cc-plugins/archive/main.zip#go-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.