go-coding-standards

Enforce idiomatic Go coding standards across source files and pull requests.

64|9|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/eduardo-sl/go-agent-skills --skill go-coding-standards-eduardo-sl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-coding-standards
Source: https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/%28code-quality%29/go-coding-standards
Command: npx skills add https://github.com/eduardo-sl/go-agent-skills --skill go-coding-standards-eduardo-sl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill ensures Go code follows idiomatic style and maintainability conventions to prevent Java-flavored or brittle Go, reduce bugs caused by poor naming, import misuse, and incorrect struct initialization, and to keep codebases consistent.

Core Features & Use Cases

  • Import Ordering & Grouping: Enforces standard, external, and internal import grouping and forbids dot imports and unnecessary aliases.
  • Naming & Declarations: Validates package, function, variable, and interface naming conventions and appropriate use of short names versus descriptive identifiers.
  • Struct Initialization & Nesting: Requires field-name struct initialization, promotes early returns to reduce nesting, and recommends clear function ordering and receiver placement.
  • Verification Checklist: Aligns code with goimports, go vet, and golangci-lint expectations and enforces enum, time, and defer best practices.
  • Use Case: Run during code review or as an agent helper to automatically flag style regressions in PRs and to suggest idiomatic fixes for authored code.

Quick Start

Ask the go-coding-standards skill to review a Go file or pull request for style, import ordering, naming, struct initialization, and linting issues.

Frequently Asked Questions about go-coding-standards

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

FAQPage Schema
How do I enforce idiomatic Go coding standards in a pull request?

To enforce idiomatic Go coding standards in a pull request, validate import grouping, naming conventions, struct initialization, and error handling. Running automated checks during code review flags style regressions and suggests fixes aligned with goimports and go vet compliance.

What is the correct import ordering for Go source files?

Correct import ordering for Go source files separates standard, external, and internal groups. This grouping mechanism prevents import misuse and satisfies golangci-lint compatibility requirements by forbidding dot imports and unnecessary aliases.

Does golangci-lint work with Go struct initialization checks?

Yes, golangci-lint compatibility extends to Go struct initialization checks by requiring explicit field-based initialization. This approach enforces idiomatic style conventions and prevents brittle code caused by incorrect struct formatting.

How do I fix Go naming conventions for functions and interfaces?

Fix Go naming conventions by validating package, function, variable, and interface names for appropriate use of short names versus descriptive identifiers. This validation process prevents bugs caused by poor naming and keeps codebases consistent.

What are the limitations of using linting for Go code review?

Limitations of using linting for Go code review include focusing strictly on style conventions like import ordering, nesting reduction, and enum best practices rather than complex architectural logic. It validates syntax compliance but does not evaluate runtime performance.