Skip to main content

Add A Go Tool

Go-installed tools are managed via a list.

Preconditionsโ€‹

  • Go is installed.
  • You verified the module path for the tool.

Stepsโ€‹

  1. Add the module path to:

    This installs as ~/.default-golang-pkgs. The file is a chezmoi template, so entries can be gated on OS or architecture.

  2. Apply:

    chezmoi apply

Hook:

Verificationโ€‹

which <tool>
<tool> --version

Rollback / Undoโ€‹

  1. Remove the module path from home/readonly_dot_default-golang-pkgs.tmpl.
  2. Re-apply:
chezmoi apply

Reconciliation rules:

RuleDetail
Removed moduleits binary is deleted from GOBIN on the next apply
Safety ledger~/.cache/chezmoi/golang-pkgs-state records binaries this tooling installed
Hand installsbinaries installed manually with go install are left untouched
Install detectionchecks the binary in GOBIN (go env GOBIN, else $(go env GOPATH)/bin)
Not usedgo list -m all, because it does not enumerate installed binaries