1
0
Files
MSE-CSEL/.devcontainer/toolchain/scripts/get-go.sh
Jacques Supcik 3967e73347 Initial commit
2026-02-18 13:34:35 +01:00

35 lines
715 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
GO_VERSION=1.24.1
remove_go() {
rm -rf /usr/local/go
rm -f /etc/profile.d/go.sh
}
install_go() {
remove_go
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
else
echo "Unsupported architecture: ${ARCH}"
exit 1
fi
echo "Installing Go ${GO_VERSION} for ${ARCH}"
curl -sSfL https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz | tar -C /usr/local -xz
echo "Go ${GO_VERSION} installed successfully"
echo "export PATH=\$PATH:/usr/local/go/bin" >> /etc/profile.d/go.sh
}
install_go