设置代理:
设置-> 应用程序 -> 代理服务器 -> proxy 设置为 http://127.0.0.1:10080
安装插件
GO: Install/Update Tools
修改配置
设置 -> 扩展 -> GO -> Alternate Tools -> 点击 编辑setting.json
{
"files.autoSave": "onFocusChange",
"go.buildOnSave": "workspace",
"go.lintOnSave": "package",
"go.vetOnSave": "package",
"go.buildTags": "",
"go.buildFlags": [],
"go.lintFlags": [],
"go.vetFlags": [],
"go.coverOnSave": false,
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.formatOnSave": true,
//"go.formatTool": "goreturns",
"go.goroot": "C:\\Go",
"go.gopath": "D:\\gopath",
"go.gocodeAutoBuild": false,
"workbench.iconTheme": "vscode-icons",
"go.useLanguageServer": true,
"http.proxy": "http://127.0.0.1:10080",
"http.proxyStrictSSL": false,
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"workbench.colorTheme": "Monokai",
"go.addTags": {
},
"go.alternateTools": {
},
"go.autocompleteUnimportedPackages": true,
"go.docsTool": "gogetdoc",
"go.formatTool": "goimports",
}