-
-
Save LucJosin/50725a300be380ed7d5bf8ebcf329f8d to your computer and use it in GitHub Desktop.
Update go to the latest version
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 | |
RELEASE=$(/usr/local/bin/go list -m -f '{{.Version}}' go@latest) | |
GO_FILE=go${RELEASE}.linux-amd64.tar.gz | |
BIN=https://go.dev/dl/${GO_FILE} | |
echo "download $GO_FILE from $BIN ..." | |
curl $BIN -L --output ${GO_FILE} | |
rm -rf /usr/local/go && tar -C /usr/local -xzf ${GO_FILE} | |
rm $GO_FILE | |
export PATH=$PATH:/usr/local/go/bin | |
go version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment