golang

jaeyeom's avatarfrom jaeyeom

Expert Go developer guide. Use when writing, debugging, or reviewing Go code.

⭐5stars🔀3forks📁View on GitHub🕐Updated Jan 4, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill serves as an expert guide for Go (Golang) development, designed to streamline the process of writing, debugging, and reviewing high-quality code. It enforces industry-standard best practices, including structured logging with the `slog` package, idiomatic interface definitions, and robust table-driven testing. By integrating essential developer tools like `golangci-lint` and `make`, it ensures that your Go projects are maintainable, performant, and compliant with modern coding standards.

Use Cases

  • Idiomatic Go Development: Generate Go code that follows strict architectural rules, such as defining interfaces where they are consumed and using structured logging for better observability.
  • Automated Testing and QA: Implement and run table-driven tests to ensure comprehensive logic coverage and clear failure reporting within the Go testing framework.
  • Code Quality Enforcement: Utilize integrated linting tools like `golangci-lint` via Bash commands to automatically detect and fix style inconsistencies and potential bugs.
  • Efficient Code Reviews: Analyze existing Go repositories to ensure compliance with project-specific rules, such as restricting command-line flag access to the main function.
namegolang
descriptionExpert Go developer guide. Use when writing, debugging, or reviewing Go code.
allowed-toolsBash, Read, Grep, Glob, Edit, Write

Go Development Skill

Instructions

When working with Go code, follow these rules:

  1. Logging: Use the log/slog package in the standard library.
    • Add appropriate log messages with proper log levels.
  2. Interfaces: Define interfaces where they are used, not where they are implemented.
    • Avoid introducing unused interfaces.
  3. Testing:
    • Use table-driven tests.
    • Clarify which case is failing in the test log.
  4. Linting:
    • Run make lint to check for issues.
    • Run make fix to auto-fix issues.
    • If running manually: golangci-lint run ./...
  5. Flags: Only the main function can access command-line flags.

Tools

  • Lint: make lint
  • Test: make test