Vscode must install the following plug-ins in go language

Time:2020-9-24

Vscode must have the following plug-ins installed:

First you have to install the golang plug-in, and then install the go toolkit.

In vs code, use the shortcut key:command+shift+P, and then type:go:install/update tools Check all 16 plug-ins and click OK to start the installation.


Installing 16 tools at /Users/maiyang/develop/goworkspace//bin
 gocode
 gopkgs
 go-outline
 go-symbols
 guru
 gorename
 dlv
 godef
 godoc
 goreturns
 golint
 gotests
 gomodifytags
 impl
 fillstruct
 goplay

Installing github.com/mdempsky/gocode SUCCEEDED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline SUCCEEDED
Installing github.com/acroca/go-symbols SUCCEEDED
Installing golang.org/x/tools/cmd/guru SUCCEEDED
Installing golang.org/x/tools/cmd/gorename SUCCEEDED
Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED
Installing github.com/rogpeppe/godef SUCCEEDED
Installing golang.org/x/tools/cmd/godoc SUCCEEDED
Installing github.com/sqs/goreturns SUCCEEDED
Installing github.com/golang/lint/golint SUCCEEDED
Installing github.com/cweill/gotests/... SUCCEEDED
Installing github.com/fatih/gomodifytags SUCCEEDED
Installing github.com/josharian/impl SUCCEEDED
Installing github.com/davidrjenni/reftools/cmd/fillstruct SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED

All tools successfully installed. You're ready to Go :).

How to modify the default configuration:

stayPreferences -> SettingThen enter go and selectsetting.json , fill in the configuration you want to modify

Automatically complete non imported packages.

“go.autocompleteUnimportedPackages”: true,

Some plug-ins of vscode need to be configured with agents before they can be installed normally. (used with VPN)

“http.proxy”: “192.168.0.100:1087”,

If you encounter code prompts using standard packages, but you cannot use your own package or third-party library to show code prompts, you can check your configuration items.

“go.inferGopath”: true,

If the referenced package uses (“ aa.com/text ”)Then the function under the text package cannot jump in. Why?

modify"go.docsTool“Gogetdoc, which is godoc by default.

“go.docsTool”: “gogetdoc”,

other

  1. When we use the import function, if we can’t pass the lint check, the automatic import will not be executed.
  2. If you need to import automatically, you must write the functions of the package you want to import completely.

With minesettings.json


{
 "go.goroot": "",
 "go.gopath": "",
 "go.inferGopath": true,
 "go.autocompleteUnimportedPackages": true,
 "go.gocodePackageLookupMode": "go",
 "go.gotoSymbol.includeImports": true,
 "go.useCodeSnippetsOnFunctionSuggest": true,
 "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
 "go.docsTool": "gogetdoc",
}

Reference articles: https://maiyang.me/post/2018-09-14-tips-vscode/

summary

This article about vscode must install the following plug-ins to this, more related vscode go language plug-in content, please search the previous articles of developeppaer or continue to browse the related articles below, I hope you can support developeppaer more in the future!