Solizardking/clawd-bot / .agents/skills/golang-naming
golang-naming
VerifiedGo (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and subtest names. Use this skill when writing new Go code, reviewing or refactoring, choosing between naming alternatives (New vs NewTypeName, isConnected vs connected, ErrNotFound vs NotFoundError, StatusReady vs StatusUnknown at iota 0), debating Go package names (utils/helpers anti-patterns), or asking about Go naming best practices. Also trigger when the user mentions MixedCaps vs snake_case, ALL_CAPS constants, Get-prefix on getters, or error string casing. Do NOT use for general Go implementation questions that don't involve naming decisions.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.2 KB |
| evals/evals.json | config | 28.0 KB |
| references/functions-methods.md | markdown | 4.0 KB |
| references/identifiers.md | markdown | 5.1 KB |
| references/packages-files.md | markdown | 3.0 KB |
| references/testing.md | markdown | 1.2 KB |
| references/types-errors.md | markdown | 4.1 KB |
references/testing.md
View on GitHub# Test Naming
## Test Functions
Test functions follow `Test` + the name of what is being tested. Use underscores for subcases.
```go
func TestParseToken(t *testing.T) { ... }
func TestServer_Handle(t *testing.T) { ... } // method test
func TestParseToken_InvalidInput(t *testing.T) { ... } // subcase
```
## Table-Driven Tests
Table-driven test case names SHOULD be **fully lowercase, descriptive phrases** — including acronyms. Use `input` for inputs and `expected` for expected outputs to make the data flow clear:
```go
tests := []struct {
name string
input string
expectedCode int
expectedErr bool
}{
{name: "empty input", input: "", expectedCode: 400, expectedErr: true},
{name: "valid token", input: "abc123", expectedCode: 200},
{name: "expired token", input: "exp", expectedCode: 401, expectedErr: true},
{name: "invalid id", input: "???", expectedCode: 400, expectedErr: true}, // "id" not "ID"
}
// Bad — mixed case in test names
{name: "valid ID", ...} // should be "valid id"
{name: "Empty Input", ...} // should be "empty input"
```
## Test Helpers
Test helper functions that panic on failure conventionally use the `must` prefix: `mustLoadFixture()`, `mustParseURL()`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |