Append @latest if doing install and version isn't specified.

This commit is contained in:
Kenny Parnell 2022-02-09 14:30:28 -05:00
parent 89ced07d86
commit 03d30a52ae
No known key found for this signature in database
GPG Key ID: 8B0A18B90F711788

View File

@ -46,6 +46,10 @@ install_default_go_pkgs() {
# if using go > 1.16 then use go install as the preferred donwload path
if [ "$go_major_version" -ge 2 ] || [ "${go_minor_version//[!0-9]*}" -ge 16 ]; then
if [[ "$name" != *"@"* ]]; then
name="${name}@latest"
fi
GOROOT="$ASDF_INSTALL_PATH/go" \
GOPATH="$ASDF_INSTALL_PATH/packages" \
PATH="$go_path:$PATH" \