My configuration
- Vps:virmach $1.25 one-month VPS
- System: Ubuntu Server 16.04 LTS 64bit Minimal
- You can create a virtual machine yourself to install a server version of Linux, or choose a shared host here
Log in to Linux
Mac or Linux users can log on to the host with commands ssh root@xxx.xxx.xxx.xxx
Window users can log on to the host using SECURECRT
Virtual machine users open your virtual machine directly
Install GO Environment
Golang website Download Address: https://golang.org/dl/
- Open the official website download address Select the corresponding system version, copy the download link
This is what I chose.
go1.10.3.linux-amd64.tar.gz: https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
cdEnter the directory you used to store the installation package. If you have trouble, you can enter it directly cd ~ .
And then execute
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
- Download complete
- Perform
tar extract to /usr/loacl directory, get go folder
tar -C /usr/local -zxvf go1.10.3.linux-amd64.tar.gz
- Add the
/usr/loacl/go/bin directory to the PATH variable. Added to /etc/profile or $HOME/.profile both can
// 习惯用vim,没有的话可以用命令`sudo apt-get install vim`安装一个vim /etc/profile// 在最后一行添加export GOROOT=/usr/local/goexport PATH=$PATH:$GOROOT/bin// wq保存退出后source一下source /etc/profile
- Execution
go version , if the actual version number, then the GO environment is installed successfully. Isn't it simple?
Run the first program
Leave a hole, and then fill in the back.