golang-conventions

Enforce Go coding conventions, error handling, and linting with golangci-lint.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/rory-data/copilot --skill golang-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-conventions
Source: https://github.com/rory-data/copilot/tree/main/skills/golang-conventions
Command: npx skills add https://github.com/rory-data/copilot --skill golang-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go codebases often drift in style and structure, leading to hard-to-read code, inconsistent error handling, and maintenance headaches. This Skill codifies Go conventions to promote clarity, consistency, and idiomatic usage across projects.

Core Features & Use Cases

  • Formatting and import rules (gofmt, goimports) to keep code clean
  • Naming, package structure, and idiom-focused guidance
  • Error handling, testing patterns, concurrency practices, and linting with golangci-lint
  • Use cases include new projects, code reviews, refactoring, and onboarding teams to Go.

Quick Start

Follow these conventions when writing, reviewing, or refactoring Go code to ensure idiomatic, readable, and maintainable programs.

Frequently Asked Questions about golang-conventions

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

FAQPage Schema
How do I enforce idiomatic Go conventions across my projects?

Enforce Go conventions by codifying rules for explicit error handling, package organization, and idiomatic naming. This ensures clear, consistent, and maintainable code across new projects, refactoring, and team onboarding.

What is the best way to structure Go project packages and naming?

Structure Go packages and naming by following idiomatic conventions that prioritize clarity. Apply consistent formatting using gofmt and goimports to keep imports and code structure clean across the project.

How do I handle errors and concurrency in Go code reviews?

Handle errors and concurrency in Go code reviews by checking for explicit error handling and safe concurrency practices. Validating these patterns during reviews prevents inconsistent behavior and maintenance headaches.

Can I use golangci-lint to enforce Go testing patterns?

Yes, you can use golangci-lint to enforce Go testing patterns and formatting rules. Linting validates that code adheres to established conventions, ensuring consistent testing and error handling across the codebase.

Does this approach support modern Go features like generics?

Yes, this approach supports modern Go features like generics in Go 1.21 and above. It provides guidance on applying contemporary idioms alongside traditional formatting and linting practices.