Use Go 1.21, refactor Go setup function

This commit is contained in:
Gabriel Simmer 2023-08-14 16:56:30 +01:00
parent 1045b2e3a3
commit ca54077433
No known key found for this signature in database

View file

@ -10,12 +10,14 @@ DIR=$(mktemp -d)
trap "rm -fr $DIR" EXIT
function dependency_go() {
go_version="1.21.0.linux-amd64" # Set the desired Go version here
if ! which go > /dev/null ; then
apt-get update
apt-get update
apt-get install -y -qq wget tar
wget --quiet https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
tar zxf go1.20.5.linux-amd64.tar.gz
export PATH=$PATH:$(pwd)/go/bin
wget --quiet "https://go.dev/dl/go$go_version.tar.gz"
tar zxf "go$go_version.tar.gz"
export PATH="$PATH:$(pwd)/go/bin"
fi
}