From 03d30a52ae739d8cd28540f7f44d6c3efb21cc7d Mon Sep 17 00:00:00 2001 From: Kenny Parnell Date: Wed, 9 Feb 2022 14:30:28 -0500 Subject: [PATCH] Append @latest if doing install and version isn't specified. --- bin/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/install b/bin/install index e17f7cd..2f3ad54 100755 --- a/bin/install +++ b/bin/install @@ -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" \