Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By cheolwanparkv1.0.0MITIn 1 marketplace
Automatic Go linting and formatting using goimports, go vet, and golangci-lint
You run one by typing its /name in Claude Code.
2 cautions to review before installing
A hook runs when Claude writes or edits files
A command runs shell commands (! syntax) when you invoke it
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Automatic Go linting and formatting for Claude Code using goimports, go vet, and golangci-lint.
goimports to format code and organize importsgo vet on edited files to catch common mistakesgolangci-lint via slash command.golangci.yml if presentgoimports - For formatting and import management:
go install golang.org/x/tools/cmd/goimports@latest
go - Standard Go toolchain (includes go vet)
golangci-lint - For comprehensive project linting:
# macOS/Linux
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Alternative: Homebrew
brew install golangci-lint
# Verify installation
golangci-lint --version
The plugin is automatically loaded when you have this repository in your Claude Code plugins directory.
The hook automatically runs when you edit or create Go files:
goimports -w to format code and organize imports (in-place modification)go vet on the package containing the file for quick checksBehavior:
go vet silently on the package (not entire project) for performance/go-lint:lint-project for comprehensive error reportingFile requirements:
.go filego.mod, go.work, or .git in parent directories)Example workflow:
// You edit a file with issues:
package main
import "fmt"
import "os" // Will be organized by goimports
func main() {
fmt.Println("Hello")
}
The hook will:
go vet silently in the backgroundTo see comprehensive lint results, run /go-lint:lint-project
Run comprehensive linting on your entire project:
# Lint entire project
/go-lint:lint-project
# Lint specific directory
/go-lint:lint-project ./cmd
# Lint specific package
/go-lint:lint-project ./internal/api
Output includes:
Example output:
## Go Linting Report
**Target:** ./...
**Project root:** /path/to/project
**Config:** .golangci.yml
### Summary
- **Errors:** 3
- **Warnings:** 0
### Errors
- **cmd/main.go:15:2** [errcheck] Error return value is not checked
- **internal/api/handler.go:42:10** [ineffassign] Ineffectual assignment to err
- **pkg/util/helper.go:8:6** [unused] func helper is unused
The plugin respects your project's .golangci.yml configuration file:
# .golangci.yml
run:
timeout: 5m
tests: true
linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- gofmt
- goimports
issues:
max-issues-per-linter: 0
max-same-issues: 0
If no config file is found, golangci-lint uses its default linters.
The hook is configured in hooks/hooks.json:
{
"description": "Automatically lint and format Go files using goimports and go vet",
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/go-lint.sh",
"timeout": 30
}
]
}
]
}
}
*.go files onlygo.mod, go.work, or .gitgoimports -w to format file in-placego vet ./... from project rootBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub cheolwanpark/claude-plugins --plugin go-lintPlugins from other owners that cover similar ground