Skip to content

Instantly share code, notes, and snippets.

@ayuxsec
Last active March 7, 2026 20:53
Show Gist options
  • Select an option

  • Save ayuxsec/b2322067f31f8f7371e0f8771982e7be to your computer and use it in GitHub Desktop.

Select an option

Save ayuxsec/b2322067f31f8f7371e0f8771982e7be to your computer and use it in GitHub Desktop.
latest_version=$(curl "https://go.dev/dl/?mode=json" -s | jq -r ".[0].version")
command -v jq || sudo apt install jq
echo "[+] Installing ${latest_version}"
wget "https://go.dev/dl/"${latest_version}".linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "${latest_version}".linux-amd64.tar.gz
/usr/local/go/bin/go version
# echo """
# # Added by go installer
# export PATH=$PATH:/usr/local/go/bin
# export PATH=$PATH:~/go/bin/
# """ >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment