Skip to content

Instantly share code, notes, and snippets.

@taking
Last active November 29, 2024 06:17
Show Gist options
  • Save taking/f4774c19f4a15704d143faf0ab4b5567 to your computer and use it in GitHub Desktop.
Save taking/f4774c19f4a15704d143faf0ab4b5567 to your computer and use it in GitHub Desktop.
#!/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
@taking
Copy link
Author

taking commented Jun 7, 2021

how-to

wget  https://gist.githubusercontent.com/taking/f4774c19f4a15704d143faf0ab4b5567/raw/eef2c862bebfe46bec196791abc8be283ae36de8/latest-go-lang-ubuntu
chmod a+x latest-go-lang-ubuntu
./latest-go-lang-ubuntu

+++
sh latest-go-lang-ubuntu 하면 에러남

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment