Skip to content

Instantly share code, notes, and snippets.

@vyorkin
Created May 28, 2025 17:41
Show Gist options
  • Save vyorkin/959d17b2e283b20235d8fed78a379d26 to your computer and use it in GitHub Desktop.
Save vyorkin/959d17b2e283b20235d8fed78a379d26 to your computer and use it in GitHub Desktop.
Go Justfile (go.tool.mod)
TOOL_MODFILE := "go.tool.mod"
audit:
go vet ./...
go tool -modfile={{TOOL_MODFILE}} staticcheck ./...
go tool -modfile={{TOOL_MODFILE}} govulncheck
tool-add TOOL:
go get -tool -modfile={{TOOL_MODFILE}} {{TOOL}}
tool-run TOOL ARGS="":
go tool -modfile={{TOOL_MODFILE}} {{TOOL}} {{ARGS}}
tool-upgrade TOOL VERSION="":
#!/usr/bin/env bash
if [ "{{VERSION}}" != "" ]; then
go get -tool -modfile={{TOOL_MODFILE}} {{TOOL}}@{{VERSION}}
else
go get -tool -modfile={{TOOL_MODFILE}} {{TOOL}}
fi
tool-remove TOOL:
go get -tool -modfile={{TOOL_MODFILE}} {{TOOL}}@none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment