Implement or audit idiomatic Go code using effective naming, errors, context, interfaces, generics, nil handling, slices/maps, documentation comments, and standard library conventions. Use when writing, refactoring, cleaning, or reviewing Golang code; reducing nesting; improving API ergonomics; checking idiomatic implementation style; or finding non-idiomatic Go in existing code.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Implement or audit idiomatic Go code using effective naming, errors, context, interfaces, generics, nil handling, slices/maps, documentation comments, and standard library conventions. Use when writing, refactoring, cleaning, or reviewing Golang code; reducing nesting; improving API ergonomics; checking idiomatic implementation style; or finding non-idiomatic Go in existing code.
Go Implementation Idioms
Build Workflow
Prefer straightforward code over abstraction. Make the happy path read down the page by handling errors early.
Use the standard library idioms already present in the repo: context, errors, fmt, io, testing, slog, net/http, and so on.
Keep names short but explanatory at their scope. Avoid package-name stutter in exported identifiers.
Wrap errors with context using %w when callers need errors.Is or errors.As.
Accept small interfaces and return concrete types. Avoid pointers to interfaces.
Use type parameters for real type relationships; do not use generics to avoid writing clear domain code.
Treat nil carefully: nil slices are usually fine for empty collections; maps must be made before writes.
Document exported packages, types, functions, methods, and non-obvious behavior for users.
Run gofmt/goimports after edits and keep generated code separate.
Audit Workflow
Inspect call sites before judging names, exported APIs, interfaces, or generic types.
Flag error handling that loses classification, context, wrapping, cancellation, or caller actionability.