-
-
Save neonxp/b67684eac7a68455f098bb593ad01265 to your computer and use it in GitHub Desktop.
Simple version manager for golang
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 | |
if [ ! -f $HOME/go/bin/go$1 ]; then | |
echo "Version $1 not found, trying to install" | |
go install golang.org/dl/go$1\@latest | |
go$1 download | |
fi | |
rm $HOME/go/bin/go || true | |
echo "Linking go to version $1" | |
ln -s $HOME/go/bin/go$1 $HOME/go/bin/go |
Author
neonxp
commented
Jul 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment