VSCODE安装Gol环境、插件、go tools及settings.json配置流程

VSCODE安装GO插件、go tools及settings.json配置流程

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,
  • 显示包代码提示
 "go.inferGopath": 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",

 

Computer science and software engineering have always been my passion

 

转自:https://www.cnblogs.com/wangchengxu/p/15892993.html

 
posted @ 2023-02-28 09:38  孤独信徒  阅读(1370)  评论(0编辑  收藏  举报