Go "installing executables with go get ... not supported" - Fix in CI
Modern Go no longer installs command-line tools with go get. In a module context go get only manages dependencies; installing an executable now requires go install pkg@version, and the old form errors.
What this error means
A CI step that runs go get github.com/org/tool to install a binary fails with installing executables with go get in module mode is no longer supported. It surfaces after upgrading to a Go version that removed the legacy behavior.
go: installing executables with 'go get' in module mode is no longer supported;
use 'go install pkg@version' insteadCommon causes
Using go get to install a tool
Older guides install CLIs with go get. In current Go that path is removed - go get now only edits the dependency graph of the current module.
A tool install run inside a module directory
Running the old command from within a module also tries to mutate that module’s go.mod, which is not what installing a standalone tool should do.
How to fix it
Use go install with an explicit version
Install the binary with go install pkg@version, which works independent of the current module.
go install github.com/org/tool@latest
go install github.com/org/tool@v1.5.0 # pin for reproducibilityTrack CLI tools as build dependencies
For tools your build needs, record them in a tools file and install them by version.
// tools.go
//go:build tools
package tools
import _ "github.com/org/tool"How to prevent it
- Install CLIs with
go install pkg@version, nevergo get. - Pin tool versions for reproducible CI installs.
- Update old scripts/READMEs that still use
go getto install tools.