Skip to content

Commit 649faae

Browse files
committed
install-vendored-go: also consider the architecture
Make sure to download the Go toolchain that matches the architecture of the host where the `Makefile` is being run.
1 parent c1d1946 commit 649faae

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

script/install-vendored-go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
# The checksums below must correspond to the downloads for this version.
44
GO_VERSION=go1.16.3
55

6-
if [ $(uname -s) = "Darwin" ]; then
7-
GO_PKG=${GO_VERSION}.darwin-amd64.tar.gz
8-
GO_PKG_SHA=f4e96bbcd5d2d1942f5b55d9e4ab19564da4fad192012f6d7b0b9b055ba4208f
9-
elif [ $(uname -s) = "Linux" ]; then
6+
case "$(uname -s):$(uname -m)" in
7+
Linux:x86_64)
108
GO_PKG=${GO_VERSION}.linux-amd64.tar.gz
119
GO_PKG_SHA=951a3c7c6ce4e56ad883f97d9db74d3d6d80d5fec77455c6ada6c1f7ac4776d2
12-
else
10+
;;
11+
Darwin:x86_64)
12+
GO_PKG=${GO_VERSION}.darwin-amd64.tar.gz
13+
GO_PKG_SHA=6bb1cf421f8abc2a9a4e39140b7397cdae6aca3e8d36dcff39a1a77f4f1170ac
14+
;;
15+
*)
1316
echo 1>&2 "I don't know how to install Go on your platform."
1417
echo 1>&2 "Please install $GO_VERSION or later and add it to your PATH."
1518
exit 1
16-
fi
19+
;;
20+
esac
1721

1822
archivesum() {
1923
shasum -a256 "$ARCHIVE"

0 commit comments

Comments
 (0)