1.安装Golang插件和Golang工具包
command+shift+Pgo:install/update tools
2.VScode go代码自动补全
使用VScode写go代码,可以配置代码自动补全
setting.json
常用配置参考:
"go.alternateTools": {
"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",
},