辗转反侧,弄了好久好久终于出山了
总结:跟vscode版本插件有关
老版本vscode DocsTool修改成godoc
新版本vscode
go get golang.org/x/tools/gopls@latest
- setting中
bash
"go.useLanguageServer": true,
"[go]": {
"editor.snippetSuggestions": "none",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"gopls": {
"usePlaceholders": true, // add parameter placeholders when completing a function
"completionDocumentation": true // for documentation in completion items
},
"files.eol": "\n", // formatting only supports LF line endings