Last active
November 29, 2024 06:17
-
-
Save taking/f4774c19f4a15704d143faf0ab4b5567 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Author by Taking | |
# (1) go language install + env | |
GO_URL="https://go.dev/dl" | |
GO_VERSION=$(curl -s 'https://go.dev/VERSION?m=text' | head -n1) | |
ARCH=$(dpkg --print-architecture) | |
GO_FILE="$GO_VERSION.linux-$ARCH.tar.gz" | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
if [ -d /usr/local/go ]; then | |
echo -e "${RED}--go exist.. PASS--${NC}" | |
else | |
echo -e "${RED}--go downloading...--${NC}" | |
cd ~/ | |
wget --no-check-certificate --continue --show-progress $GO_URL/$GO_FILE | |
tar -xzf $GO_FILE | |
sudo mv go /usr/local | |
rm ~/$GO_FILE | |
echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile | |
echo 'export GOPATH=$HOME/GO' | sudo tee -a /etc/profile | |
echo 'export PATH=$PATH:$GOPATH/bin' | sudo tee -a /etc/profile | |
source /etc/profile | |
## Test if Golang is working | |
go version | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how-to
+++
sh latest-go-lang-ubuntu 하면 에러남