vscode 用 gopls : is the official language server for the Go language vscode 设置参考: vscode-gopls 设置 注意: 打开一个项目,不能打开多个项目。即打开有 go.mod的目录 ,否则不能跳转,甚至有错误提示。 { "go.useLanguageServer" : true , "[go]" : { "editor.formatOnSave" : true , "editor.codeActionsOnSave" : { "source.organizeImports" : true , } , // Optional: Disable snippets, as they conflict with completion ranking. "editor.snippetSuggestions" : "none" , } , "[go.mod]" : { "editor.formatOnSave" : true , "editor.codeActionsOnSave" : { "source.organizeImports" : true , } , } , "gopls" : { // Add parameter placeholders when completing a