> golang-language
Core idioms, style guides, and best practices for writing idiomatic Go code. Use when writing Go code following official style guides and idiomatic patterns. (triggers: **/*.go, go.mod, golang, go code, style, idiomatic)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/golang-language?format=md"Golang Language Standards
Priority: P0 (CRITICAL)
Guidelines
- Fmt: Run
gofmtorgoimportson save. - Naming: Use
camelCasefor internal,PascalCasefor exported. - Packages: Short, lowercase, singular, no underscores (e.g.,
net/httpnotnet_http). - Interfaces: Define where used, not where implemented. Small interfaces (1-2 methods).
- Errors: Return error as last return value. Handle immediately.
- Variables: Short names for small scope (
i,ctx), descriptive for large scope. - Slices: Prefer slices over arrays. Use
make()for capacity. - Const: Use
iotafor enums.
Anti-Patterns
- No
init: Use constructors, notinit(). - No Globals: Use DI, not global mutable state.
- No
panic: Return errors, don't panic. - No
_ignored errors: Always check and handle errors. - No stutter:
log.Error, notlog.LogError.
references
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)