You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rwxrob-dot/install/ubuntu/install-go

34 lines
641 B
Bash

#!/usr/bin/env bash
set -e
install_17() {
cd "$(mktemp -d)"
os=linux
arch=amd64
file=$(curl -sSL "https://golang.org/dl/?mode=json" \
| jq -r '.[0].files[]
| select(.os == "'"$os"'")
| select(.arch == "'"$arch"'")
| .filename')
curl -sSLO \
-H "Accept: application/vnd.github.v3+json" \
"https://dl.google.com/go/$file"
sudo tar xzf "$file" -C /usr/local/
echo "Make sure /usr/local/go/bin is in PATH"
}
upgrade_18() {
/usr/local/go/bin/go install golang.org/dl/go1.18beta2@latest
"$GOBIN/go1.18beta2" download
go install golang.org/x/tools/gopls@latest
}
#install_17
upgrade_18