go-personal-convention
CommunityWrite clear, consistent Go code
Authordaominah
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This guide removes ambiguity and inconsistency in Go code by prescribing straightforward conventions for error formatting, boolean naming, and enum-like fields so code reviews and maintenance become faster and less error-prone.
Core Features & Use Cases
- Error wrapping and context: Encourage using fmt.Errorf with %w and including a brief description of the failing operation so logs show which call produced the error.
- Boolean naming: Require boolean variables and struct fields to be prefixed with Is for exported or is for unexported identifiers to make intent explicit.
- Enum-like string types: Define named string types with constant values, store them as TEXT in the database, and prefer human-readable UPPERCASE values to avoid brittle schema migrations.
- Use Case: Apply these rules when authoring or reviewing service code, libraries, and database models to improve readability and simplify debugging.
Quick Start
Ask the assistant to review a Go source file and suggest changes to use fmt.Errorf with %w for error returns, rename boolean fields to Is/is prefixes, and convert fixed-value fields into named string types with uppercase constant values.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: go-personal-convention Download link: https://github.com/daominah/gostructure/archive/main.zip#go-personal-convention Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.