docs/dev-tools/backends/go.md
The go backend builds Go command-line packages with go install. Use the
import path of the executable package, which may include /cmd/TOOL or a major
version suffix such as /v4. Libraries belong in your application's go.mod.
The code for this is inside the mise repository at ./src/backend/go.rs.
Install Go and the tool in the current project. The configured Go installation is available while mise builds the dependent tool:
mise use [email protected] go:github.com/DarthSim/hivemind
mise exec -- hivemind --help
This records both tools in mise.toml; add -g for global configuration.
Source builds may also need Git, a C compiler, or native libraries, depending on
the package and whether it uses cgo.
List available versions with mise ls-remote go:github.com/DarthSim/hivemind.
To select one, run mise use go:github.com/DarthSim/hivemind@VERSION, replacing
VERSION with a listed release. mise writes the resulting executable into its
own installation directory instead of your ordinary GOBIN.
Private modules use Go's normal VCS authentication. Export GOPRIVATE, or
define it in mise's [env] configuration, so mise delegates version discovery
to Go instead of querying the public module proxy itself. Values set only with
go env -w are not read by mise when choosing the discovery path:
[env]
GOPRIVATE = "github.com/acme/*"
Go uses GOPRIVATE as the default for both GONOPROXY and GONOSUMDB. If you
configure those variables separately, set each one according to the proxy and
checksum-database privacy you need.
You can also pin a specific Go module version, including an unreleased pseudo-version:
[tools]
"go:github.com/grafana/oats" = "v0.7.1-0.20260703092802-96201f1b8136"
If you need to resolve an unreleased revision directly from VCS instead of the
module proxy, combine the pinned version with install_env:
[tools]
"go:github.com/grafana/oats" = { version = "v0.7.1-0.20260703092802-96201f1b8136", install_env = { GOPROXY = "direct", GONOSUMDB = "github.com/grafana/oats" } }
The following tool-options are available for the go backend—these
go in [tools] in mise.toml.
install_envSet environment variables for the go install command. mise still sets GOBIN
to the tool install directory after applying install_env. Put GOPRIVATE in
[env] as shown above when it must also affect version discovery.
[tools]
"go:github.com/acme/my-tool" = { version = "latest", install_env = { GOPRIVATE = "github.com/acme/*" } }
tagsSpecify Go build tags (passed as go install -tags):
[tools]
"go:github.com/golang-migrate/migrate/v4/cmd/migrate" = { version = "latest", tags = "postgres" }
# equivalent array form:
# "go:github.com/golang-migrate/migrate/v4/cmd/migrate" = { version = "latest", tags = ["postgres", "mysql"] }
GOPRIVATE and your Go/Git credentials; mise's GitHub token is not a substitute for VCS authentication.