在src中新建目录,结构如下所示(如果已有则不用新建,将没有的补全即可):
golang
x
目录创建成功后,在x目录中执行
git clone https://github.com/golang/tools.git tools
然后将下载的tools目录拷贝一份至golang目录,至此,目录结构变为:
golang
tools
x
tools
到此,当vscode再次出现安装提示的时候,我们点击安装,就可以安装成功了。
{
"go.autocompleteUnimportedPackages": true,
"go.gocodePackageLookupMode": "go",
"go.gotoSymbol.includeImports": true,
"go.useCodeSnippetsOnFunctionSuggest": true,
"go.inferGopath": true,
"go.gopath": "C:/Users/67252/go",
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.buildOnSave": true,
"go.lintOnSave": true,
"go.vetOnSave": true,
"go.buildFlags": [],
"go.lintFlags": [],
"go.vetFlags": [],
"go.formatOnSave": true,
"go.formatTool": "goreturns",
"go.goroot": "d:/go",
}
有疑问加站长微信联系(非本文作者)