everything-claude-code/.cursor/rules/golang-coding-style.md
Affaan Mustafa 0e9f613fd1 Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)"
This reverts commit 1bd68ff534202ac2bf8c1eb264ea33a1302907a6.
2026-02-20 01:11:30 -08:00

661 B

description, globs, alwaysApply
description globs alwaysApply
Go coding style: gofmt mandatory, small interfaces, error wrapping with context
**/*.go
false

Go Coding Style

This file extends common/coding-style.md with Go specific content.

Formatting

  • gofmt and goimports are mandatory — no style debates

Design Principles

  • Accept interfaces, return structs
  • Keep interfaces small (1-3 methods)

Error Handling

Always wrap errors with context:

if err != nil {
    return fmt.Errorf("failed to create user: %w", err)
}

Reference

See skill: golang-patterns for comprehensive Go idioms and patterns.