Developer

Environment for Ubuntu 20.04 with Golang1.17.2

# Modify to Tsinghua list first.
apt update
apt install vim curl wget git -y

# Add Nginx list.
echo "deb http://nginx.org/packages/mainline/ubuntu focal nginx" > /etc/apt/sources.list.d/nginx.list

curl -o /tmp/nginx_signing.key https://nginx.org/keys/nginx_signing.key
mv /tmp/nginx_signing.key /etc/apt/trusted.gpg.d/nginx_signing.asc

# Check Nginx and Redis version.
apt-cache madison nginx redis

# Install Nginx and Redis.
apt install nginx redis -y

# Install Golang1.17.2
wget https://studygolang.com/dl/golang/go1.17.2.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version

# Start Redis with default config.
redis-server /etc/redis/redis.conf

# export PATH=$PATH:/usr/local/go/bin => ~/.profile
source ~/.profile

# Set Proxy for go install (or go get).
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct

# Install Go-Redis for go environment.
go install github.com/go-redis/redis/[email protected]
# go env -w GO111MODULE=off

# Install Go Iris for go environment.
go install github.com/kataras/iris/[email protected]

GitHub

View Github