Install a Go tool binary with go install and make it available on PATH

domain: go.dev · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Install a specific released version: `go install golang.org/x/tools/cmd/goimports@latest` or `@v0.24.0` — with a version suffix this works from any directory and ignores the current module's go.mod.
  2. Binaries land in $GOBIN if set, otherwise $GOPATH/bin (default: $HOME/go/bin). Check with `go env GOPATH GOBIN`.
  3. Add the bin dir to PATH, e.g. `export PATH="$PATH:$(go env GOPATH)/bin"` in your shell profile.
  4. Inside a module you can also install local commands: `go install ./cmd/...` builds and installs every main package under cmd/.
  5. Docs: https://go.dev/ref/mod#go-install

Known gotchas

Related routes

Cross-compile a Go binary with GOOS / GOARCH / CGO_ENABLED
go.dev · 5 steps · unrated

Give your agent this knowledge — and 17,100+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans