diff options
author | Samveen <samveen@samveen.in> | 2023-01-29 20:07:50 +0530 |
---|---|---|
committer | Thomas Buckley-Houston <tom@tombh.co.uk> | 2023-01-30 09:03:55 -0500 |
commit | 1591cf8e6a4b371d61b101371867a27102504cd2 (patch) | |
tree | 0297c58e7c749961ddb6d63382d77fb78807f0c5 | |
parent | b389228682f80b6025df1bc245bdcb741d736c6d (diff) |
[scripts/misc.bash]Remove hard-coded arch in golang download, and use build platform arch instead.v1.8.1
-rw-r--r-- | scripts/misc.bash | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/misc.bash b/scripts/misc.bash index e3bd51a..2bf0001 100644 --- a/scripts/misc.bash +++ b/scripts/misc.bash @@ -51,10 +51,12 @@ function install_golang() { local version && version=$(parse_golang_version_from_go_mod "$path") [ "$GOPATH" = "" ] && _panic "GOPATH not set" [ "$GOROOT" = "" ] && _panic "GOROOT not set" + GOARCH=$(uname -m) + [[ $GOARCH == aarch64 ]] && GOARCH=arm64 echo "Installing Golang v$version... to $GOROOT" curl -L \ -o go.tar.gz \ - https://dl.google.com/go/go"$version".linux-amd64.tar.gz + https://dl.google.com/go/go"$version".linux-"$GOARCH".tar.gz mkdir -p "$GOPATH"/bin mkdir -p "$GOROOT" tar -C "$GOROOT/.." -xzf go.tar.gz |