golang-code-style

Codify Go code style, formatting, and conventions for consistent projects.

5|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/omarluq/og-template --skill golang-code-style-omarluq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-code-style
Source: https://github.com/omarluq/og-template/tree/main/.agents/skills/golang-code-style
Command: npx skills add https://github.com/omarluq/og-template --skill golang-code-style-omarluq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go code style, formatting, and conventions are codified to reduce churn, improve readability, and ensure a consistent developer experience across projects.

Core Features & Use Cases

  • Line Length & Breaking: guidance on wrapping and breaking lines at semantic boundaries for readability.
  • Variable Declarations & Composite Literals: rules for short declarations, zero-value initialization, and named-field literals.
  • Control Flow & Function Design: early returns, minimal nesting, small focused functions, and explicit curvature of contracts.
  • Type Handling & Code Organization: pointer vs value decisions, grouping related declarations, and package organization.
  • Cross-References: see related skills for naming conventions, design patterns, and linter integration.

Quick Start

Run the Go code style guidelines on your project and address violations reported by your linters to improve readability and consistency.

Frequently Asked Questions about golang-code-style

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

FAQPage Schema
What are the Go code style guidelines for line length and control flow?

Go code style guidelines for line length and control flow recommend wrapping at semantic boundaries, using early returns, and minimizing nesting to improve readability. Small, focused functions maintain explicit contract curvature.

How do I enforce consistent formatting and naming conventions in a Golang project?

To enforce consistent formatting and naming in a Golang project, apply codified style guidelines during coding and reviews, then configure linters to automatically report violations for variable declarations and module organization.

When should I use pointer vs value types in Go code organization?

Pointer vs value decisions in Go code organization depend on grouping related declarations and managing contract curvature. You should explicitly handle type decisions to ensure consistent package organization and clean code structure.

Does this Go code style guidance cover composite literals and variable declarations?

Yes, the Go code style guidance covers composite literals and variable declarations by providing rules for short declarations, zero-value initialization, and named-field literals to reduce churn and improve readability.

What is the best way to configure linters for Go code style violations?

The best way to configure linters for Go code style violations is to run codified style guidelines across your project and address reported violations, using cross-references to related skills for linter integration and design patterns.