go-functions-methods
CommunityGo function and method best practices.
Authorv0lka
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Go developers often struggle to write correct and maintainable functions and methods, suffering from inconsistent receiver choices, unclear return parameters, and unsafe defer usage. This Skill provides clear guidelines to improve correctness, readability, and maintainability of Go code.
Core Features & Use Cases
- Enforces receiver type selection rules (pointer vs value) to reflect mutability and semantics.
- Encourages named return parameters and avoids naked returns where clarity suffers.
- Promotes using io.Reader (not filenames) to keep code flexible and testable.
- Guides safe defer usage and captures semantics for closures and receivers.
- Use Case: When implementing a new Go type with methods, apply these rules to prevent subtle bugs and enable easier testing.
Quick Start
Follow these guidelines when creating or refactoring a Go type to ensure proper receiver choice, named results, and safe defer usage.
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-functions-methods Download link: https://github.com/v0lka/skills/archive/main.zip#go-functions-methods 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 510,000+ vetted skills library on demand.