vscode开发golang时会出现,dot import的时候无法跳转到定义的问题。
解决方式:
go get github.com/zmb3/gogetdoc
然后在vs code的settings.json配置文件中添加
"go.docsTool": "gogetdoc",
以下是完整的settings.json
{
"files.autoSave": "onFocusChange",
"go.buildOnSave": true,
"go.lintOnSave": true,
"go.vetOnSave": true,
"go.buildFlags": [],
"go.lintFlags": [],
"go.vetFlags": [],
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.formatOnSave": false,
"go.formatTool": "goreturns",
"go.docsTool": "gogetdoc",
"go.gopath": "D:\\工作\\XXXX",
"editor.fontSize": 18
}
有疑问加站长微信联系(非本文作者)