搜索 "go" 安装扩展
在 VS Code 中,使用快捷键: command+shift+P ,然后键入: go:install/update tools ,将所有插件都勾选上,然后点击 OK 即开始安装。
打开 setting.json
{
"go.gopath": "D:\\Go",
"go.goroot": "D:\\GoPath",
"go.inferGopath": true,
"go.autocompleteUnimportedPackages": true,
"go.gocodePackageLookupMode": "go",
"go.gotoSymbol.includeImports": true,
"go.useCodeSnippetsOnFunctionSuggest": true,
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.docsTool": "gogetdoc",
"go.formatTool": "goimports",
"go.useLanguageServer": true
}
网友评论