golang plugin for asdf version manager
- GNU Core Utils -
brew install coreutils
- GNU Core Utils -
apt install coreutils
- curl -
apt install curl
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
Check the asdf readme for instructions on how to install & manage versions of go.
After using go get
to install a package you need to run asdf reshim golang
to get any new shims.
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
github.com/Dreamacro/clash
github.com/jesseduffield/lazygit
You can specify a non-default location of this file by setting a ASDF_GOLANG_DEFAULT_PACKAGES_FILE
variable.
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
.
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