Last active
April 2, 2025 18:08
-
-
Save senapk/d05ac21f9027aa9bb43acdb4a0ae11d8 to your computer and use it in GitHub Desktop.
script para instalar o golang no codespace
This file contains hidden or 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
# para desinstalar o go caso tenha baixado anteriormente | |
sudo rm -rf /usr/local/go | |
# para desisntalar o go caso tenha baixado via apt | |
sudo apt remove --purge golang-go -y | |
sudo apt autoremove -y | |
# para instalar a versão mais nova | |
versao='go1.24.2.linux-amd64.tar.gz' | |
wget https://go.dev/dl/$versao | |
sudo tar -C /usr/local -xzf $versao | |
rm $versao | |
#check export before insert in .profile | |
if ! grep -q "export PATH=\$PATH:/usr/local/go/bin" ~/.profile; then | |
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile | |
fi | |
echo "reinicie o terminal com Control D" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment