summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamveen <samveen@samveen.in>2023-01-29 20:07:50 +0530
committerThomas Buckley-Houston <tom@tombh.co.uk>2023-01-30 09:03:55 -0500
commit1591cf8e6a4b371d61b101371867a27102504cd2 (patch)
tree0297c58e7c749961ddb6d63382d77fb78807f0c5
parentb389228682f80b6025df1bc245bdcb741d736c6d (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.bash4
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