Skip to content

Instantly share code, notes, and snippets.

@icio
Created February 19, 2021 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icio/6c11a01caad3d3da51fb26369d663aa6 to your computer and use it in GitHub Desktop.
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/
#!/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 )
@icio
Copy link
Author

icio commented Feb 19, 2021

Usage: usego 1.16 or usego tip and have your GOROOT=$HOME/sdk/go and PATH=$GOROOT/bin:$PATH

@icio
Copy link
Author

icio commented Feb 19, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment