Skip to content

Official multiple installing method based Go plugin for asdf-vm.

License

Notifications You must be signed in to change notification settings

yacchi/asdf-go-sdk

Repository files navigation

asdf-go-sdk Build Lint

Go plugin for the asdf version manager.

This plugin is based on the official installation method of installing multiple go versions.

Since development environments such as Visual Studio Code and JetBrains IDEs (e.g. GoLand, IntelliJ) are the same way to install Go SDK, you can work smoothly with these development environments.

However, it is recommended to use the latest version of Go unless there is a specific reason not to.

Why?

Environments installed with asdf are usually stored in ASDF_DATA_DIR/installs/{PLUGIN_NAME}.

For the Go language, it is usually installed under HOME/sdk if you use the official installation method. Also, some development environments (e.g., VSCode and JetBrains IDEs) are installed in the same location.

Therefore, if you follow asdf's method, you will have to maintain the Go environment twice.

This plugin adds the Go SDK to HOME/sdk using Go installed on the system, and provides only the functions used by asdf.

It does not support other GOPATH management or environments where Go is not installed on the system, so if you need those, please use other methods (e.g. asdf-golang).

Dependencies

  • Requires go version 1.12 or higher
  • git

Install

Plugin:

asdf plugin add go-sdk
# or
asdf plugin add go-sdk https://github.com/yacchi/asdf-go-sdk.git

go-sdk:

# Show all installable versions
asdf list-all go-sdk

# Install specific version
asdf install go-sdk latest

# Set a version globally (on your ~/.tool-versions file)
asdf global go-sdk latest

# Now go-sdk commands are available
go version

# If you have installed or uninstalled go sdk without using asdf,
# you can use the following command to make asdf recognize it.
asdf go-sdk sync

Check asdf readme for more instructions on how to install & manage versions.

Configuration

Environment variables

  • GO_SDK_PATH - the directory where the Go SDK will be installed (default is $HOME/sdk)
  • GO_SDK_LOW_LIMIT_VERSION - the lower limit of the version displayed by list-all (default is 1.12.0)

Contributing

Contributions of any kind welcome! See the contributing guide.

Thanks goes to these contributors!

License

See LICENSE © Yasunori Fujie