Created
February 19, 2021 12:14
-
-
Save icio/6c11a01caad3d3da51fb26369d663aa6 to your computer and use it in GitHub Desktop.
usego script for installing any Go version (including tip) into ~/sdk using https://pkg.go.dev/golang.org/dl/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
VERS="${1:?Usage: $0 1.x.x}" | |
test -d ~/sdk || mkdir ~/sdk | |
cd ~/sdk | |
unset GOROOT | |
go get golang.org/dl/go$VERS | |
go$VERS download | |
test -d go && rm go | |
ln -s go$VERS go | |
( set -x; ~/sdk/go/bin/go version ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
usego 1.16
orusego tip
and have yourGOROOT=$HOME/sdk/go
andPATH=$GOROOT/bin:$PATH