This is a creation in Article, where the information may have evolved or changed.
First install the Go plugin in Vscode
Then when you run the go file, Vscode prompts you to install gopkgs and then selects install all.
There are six packages that will fail to install:
Golang.org/x/tools/cmd/guru
Golang.org/x/tools/cmd/gorename
Github.com/acroca/go-symbols
Github.com/ramya-rao-a/go-outline
Github.com/sqs/goreturns
Github.com/golang/lint/golint
The reason is that there is no corresponding file under the Golang.org/x/tools folder under SRC
For example:
Golang.org/x/tools/cmd/guru Correspondence Golang.org/x/tools/cmd/guru
Golang.org/x/tools/cmd/gorename Correspondence Golang.org/x/tools/cmd/gorename
Github.com/acroca/go-symbols Correspondence Golang.org/x/tools/go/buildutil
Github.com/ramya-rao-a/go-outline Correspondence Golang.org/x/tools/go/buildutil
Github.com/sqs/goreturns Correspondence Golang.org/x/tools/imports
So create a new golang.org/x/folder under SRC
Then CD to the golang.org/x folder
Execute git clone http://github.com/golang/tools
A more Tools folder will be found under the Golang.org/x folder
You can see that the corresponding file is already available, then CD to:
Golang.org/x/tools/cmd/guru Execute Go Install
Golang.org/x/tools/cmd/gorename Execute Go Install
Github.com/acroca/go-symbols Execute Go Install
Github.com/ramya-rao-a/go-outline Execute Go Install
Github.com/sqs/goreturns Execute Go Install
The Golint package is a bit special and should be installed like tools in the Golang.org/x folder:
git clone http://github.com/golang/lint
At this time golang.org/x will be more than one lint folder
And now Github.com/golang/lint/golint has the corresponding file.
Last CD to Github.com/golang/lint/golint folder, execute go install
The installation package is finally installed.
I am golang novice, above is my personal understanding, should have the mistake, also please understand ...
559 Reads