Created
March 14, 2024 15:56
-
-
Save mnlwldr/788949ccffc99e5c91fd65e4132014a0 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