2013-08-08 03:23:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-13 01:59:41 +00:00
|
|
|
# Installs golang from the web
|
2013-08-08 03:23:13 +00:00
|
|
|
|
2023-01-26 00:02:55 +00:00
|
|
|
version="1.19"
|
2021-12-03 01:06:33 +00:00
|
|
|
ARCH=$(uname -m)
|
2022-04-05 23:54:47 +00:00
|
|
|
if [ "$ARCH" = "x86_64" ]; then
|
|
|
|
ARCH=amd64
|
|
|
|
fi
|
|
|
|
|
2013-08-08 03:23:13 +00:00
|
|
|
if [[ "$UNAME_STR" == "Darwin" ]]; then
|
2022-04-05 23:54:47 +00:00
|
|
|
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.darwin-$ARCH.pkg"
|
2021-12-03 01:06:33 +00:00
|
|
|
sudo installer -target / -pkg "$TMP_DIR/go${version}.darwin-$ARCH.pkg"
|
2013-08-08 03:23:13 +00:00
|
|
|
elif [[ "$UNAME_STR" == "Linux" ]]; then
|
2022-04-05 23:54:47 +00:00
|
|
|
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.linux-$ARCH.tar.gz"
|
2021-12-03 01:06:33 +00:00
|
|
|
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf "$TMP_DIR/go${version}.linux-$ARCH.tar.gz"
|
2013-08-08 03:23:13 +00:00
|
|
|
fi
|