golang-patterns

Apply idiomatic Go patterns for error handling, concurrency, and package design.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill golang-patterns-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-patterns
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/skills/golang-patterns
Command: npx skills add https://github.com/luongldptit/move-ticket --skill golang-patterns-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common pain point of writing Go code that is inconsistent, hard to maintain, or deviates from community-accepted best practices, which leads to bugs, performance issues, and onboarding friction for development teams.

Core Features & Use Cases

  • Comprehensive Go Development Guidance: Covers core principles, error handling, concurrency patterns, interface and struct design, package organization, performance optimization, and tooling integration for all Go development workflows.
  • Actionable Code Examples: Provides clear good/bad code comparisons for every pattern to demonstrate correct idiomatic usage.
  • Use Case: Use this Skill when building a new Go microservice to implement proper graceful shutdown and worker pool patterns, or when reviewing a teammate's PR to catch non-idiomatic error wrapping and global state usage.

Quick Start

Use the golang-patterns skill to review your recent Go PR for adherence to idiomatic error handling and concurrency safety best practices.

Frequently Asked Questions about golang-patterns

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

FAQPage Schema
What are idiomatic Go patterns for proper error handling?

Idiomatic Go error handling involves properly wrapping errors and avoiding global state usage. This approach eliminates inconsistent, non-maintainable Go application code by ensuring safe error propagation and maintainable codebases.

How do I review a Go PR for concurrency safety best practices?

Reviewing Go PRs for concurrency safety involves checking worker pool patterns and proper synchronization. This ensures safe concurrency by identifying non-idiomatic code that could lead to race conditions or performance bottlenecks.

What's the best way to structure a Go microservice for maintainability?

Structuring a Go microservice requires standard project layout and proper package organization. This ensures maintainable code by applying idiomatic patterns for interface and struct design, eliminating onboarding friction.

How do I implement graceful shutdown in a Go application?

Implementing graceful shutdown in Go requires proper worker pool management and signal handling. This pattern ensures safe concurrency and clean resource release, preventing data loss during application termination.

When do I need to refactor existing Go codebases for idiomatic code?

Refactoring Go codebases is needed when code deviates from community-accepted best practices. This process fixes bugs and performance issues by applying idiomatic patterns for efficient memory usage and proper error handling.

Does this approach cover Go package and module design?

Yes, this approach covers designing Go packages and modules. It provides comprehensive guidance on package organization, interface design, and tooling integration to ensure standard project layout and maintainable code.