|
1. VSCODE插件库安装GO插件
2. 安装Go插件所依赖的go tools,上面的go插件会提示你安装它的一些依赖及工具。
- 如果没有提示,可以点击右下角 Analysis Tools Missing。最后点击 Install 安装。
- 或者按ctrl+shift+p 调出命令面板,输入go install tools
- 全选Go: Install/Update Tools
3. 配置settings.json
- "go.autocompleteUnimportedPackages": true,
复制代码- 设置引用子级包下的函数跳转,如"gonote/util" 的util内的函数
- "go.docsTool": "gogetdoc",
复制代码修改 "go.docsTool" 为 gogetdoc,默认是 godoc 4. 推荐设置
- "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",
复制代码 |
|