Today configuration environment to get a half day, the reason is Golang official website was wall, unable to download package.
1. Installing Golang
1). Download on official website
2). Unzip and move to /usr/localin the download directory, tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
3). Add environment Variables in ~/.BASHRC
export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$PATH:$GOROOT/bin:GOPATH
4). After completing the environment settings, use the source ~./bashrc
environment variable to take effect, then restart the terminal input to go
see if it is successful.
2. Configuring the Vscode Environment
1). Install the Go plugin
2). Build A. Go file in src/, and then Vscode automatically prompts you to install the plugin
Installation Results
At this point there will be 6 package installation errors, see log Discovery download from golang.org download tool caused.
3). Execution
mkdir $GOPATH/src/golang.org/x -p
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/tools
Guru
cd $GOPATH/src/golang.org/x/tools/cmd/guru
go install
Gorename
cd $GOPATH/src/golang.org/x/tools/cmd/gorename
go install
Goreturns
cd $GOPATH/src/github.com/sqs/goreturns
go install
Golint
cd $GOPATH/src/github.com/golang/lint
go install
Go-outline
cd $GOPATH/src/github.com/ramya-rao-a/go-outline
go install
Go-symbols
cd $GOPATH/src/github.com/acroca/go-symbols
go install
It's done!