Use vscode to configure go development environment

Recently, the go language has become popular, and VS code has become popular at the same time. It not only has many plug-ins, but also is very light. So how to configure the go development environment using VS code?

1. Configure GOPATH and GOROOT

GOROOT=/usr/local/go
export GOROOT
export GOPATH=/Users/XXXX/Documents/govscode
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN:$GOROOT/bin

2. Install the VScode plugin

go plug-in, at the same time a pop-up box will display automatic installation of extension plug-ins

3. Create the following directories under the GOPATH directory:

Insert picture description here

4. Write Go language code under src

To get more go resources, please add VX:daydayit, and note go

Insert picture description here

Guess you like

Origin blog.csdn.net/Think_IT/article/details/111047694