一键导入
linting-go-code
Lint and format Go code. Use when you need to run linters, fix lint errors, format code, or understand why a linter is complaining.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Lint and format Go code. Use when you need to run linters, fix lint errors, format code, or understand why a linter is complaining.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Develop CLI applications in Go. Use when creating or modifying CLI commands, adding flags or arguments, implementing command workflows, building interactive prompts, handling signals and exit codes, or working with stdin/stdout/stderr. Currently uses Cobra for command structure and Huh for interactive UI.
Build Go binaries for local development or release. Use when you need to compile the project, troubleshoot build failures, or understand the build pipeline.
Run Go unit tests, coverage reports, and benchmarks. Use when you need to run tests, check coverage, run benchmarks, or regenerate mocks after interface changes.
Apply Go coding standards when writing or modifying Go code. Use when implementing functions, using dependency injection, handling errors idiomatically, or working with interfaces. For test conventions, use the `writing-go-tests` skill instead.
Write Go tests following project conventions. Use when creating test files, writing unit or integration tests, choosing mocks, or setting up test fixtures. Covers test naming, assertions, mock usage, table-driven patterns, and common pitfalls.
| name | linting-go-code |
| description | Lint and format Go code. Use when you need to run linters, fix lint errors, format code, or understand why a linter is complaining. |
All commands run from the Go module root (cova/).
task lint
Runs golangci-lint (the master linter — all individual linters run through it) plus typos for spell checking. Auto-fixes what it can.
task fmt
Formats code through golangci-lint (gofumpt + goimports + golines). Never run these formatters standalone — always use task fmt.
When suppressing a lint in code, the configuration requires both a specific linter name and an explanation:
//nolint:gochecknoinits // Cobra requires an init function to set up the command structure.
Blanket //nolint without a linter name is not allowed.
//nolint:lintername // reason directive.golangci.yml