Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?



golang plugin for asdf version manager



Linux (Debian)


asdf plugin add golang


Check the asdf readme for instructions on how to install & manage versions of go.


To set GOROOT in your shell's initialization add the following:

zsh shell
. ~/.asdf/plugins/golang/set-env.zsh

fish shell
. ~/.asdf/plugins/golang/

When using go get or go install

After using go get or go install to install a package you need to run asdf reshim golang to get any new shims.

Default go get packages

asdf-golang can automatically install a default set of packages with go get -u $PACKAGE right after installing a new Go version. To enable this feature, provide a $HOME/.default-golang-pkgs file that lists one package per line, for example:

// allows comments

You can specify a non-default location of this file by setting a ASDF_GOLANG_DEFAULT_PACKAGES_FILE variable.

Version selection

When using .tool-versions or .go-version, the exact version specified in the file will be selected.

When using go.mod, the highest compatible version that is currently installed will be selected. As per the Go modules reference, that is the highest minor version with a matching major version. For example, a go 1.14 directive in a go.mod file will result in the highest installed 1.minor.patch being selected, not necessarily 1.14.patch.

Note: Users can explicitly exclude or include go.mod and by setting ASDF_GOLANG_MOD_VERSION_ENABLED. Currently it defaults to true, but that may change in the future, so it should be explicitly set.

Architecture Override

The ASDF_GOLANG_OVERWRITE_ARCH variable can be used to override the architecture that is used for determining which Go build to download. The primary use case is when attempting to install an older version of Go for use on an Apple M1 computer as Go was not being built for ARM at the time.


> asdf install golang 1.15.8
Platform 'darwin' supported!
URL: returned status 404


> ASDF_GOLANG_OVERWRITE_ARCH=amd64 asdf install golang 1.15.8
Platform 'darwin' supported!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116M  100  116M    0     0  98.6M      0  0:00:01  0:00:01 --:--:-- 98.6M
verifying checksum
/Users/<home>/.asdf/downloads/golang/1.15.8/archive.tar.gz: OK
checksum verified

Skipping Checksums

By default we try to verify the checksum of each install but ocassionally that's not possible. If you need to skip the checksum for some reason just set ASDF_GOLANG_SKIP_CHECKSUM.


Feel free to create an issue or pull request if you find a bug.


  • Assumes Linux, FreeBSD, or Mac
  • Assumes x86_64, i386, i686, armv6l, armv7l, arm64 and ppc64le


MIT License