在用vscode尝试搞一下go的开发环境,记录一下
1,setting.json
{
"editor.wordWrap": "on",
// 如果useLanguageServer设为true,那么在编写代码时引入本地没有的package时,会自动下载安装
// 就是有时候会非常卡,保存go的编码文件时偶尔会卡死。这点你们自己取舍吧
"go.useLanguageServer": false,
"editor.minimap.renderCharacters": false,
"editor.minimap.enabled": false,
"terminal.external.osxExec": "iTerm.app",
"go.docsTool": "guru",
"go.testFlags": ["-v","-count=1"],
"go.buildTags": "",
"go.buildFlags": [],
"go.lintFlags": [],
"go.vetFlags": [],
"go.coverOnSave": false,
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.formatTool": "gofmt",
"go.gocodeAutoBuild": false,
"go.goroot": "/usr/local/go",
"go.gopath": "/Users/jicaihong/mygo",
"go.autocompleteUnimportedPackages": true,
"debug.console.fontSize": 16,
"debug.console.lineHeight": 30,
"editor.fontSize": 20,
"editor.fontFamily": "Fira Code",
"terminal.integrated.inheritEnv": false,
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"explorer.confirmDelete": false,
"editor.suggestSelection": "first",
"explorer.confirmDragAndDrop": false,
"window.zoomLevel": -2,
"editor.mouseWheelZoom": true,
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
"security.workspace.trust.untrustedFiles": "open",
// 这是我的代理,有的话可以设置一下
// "http.proxy": "http://127.0.0.1:7890",
}
2,launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"env": {},
"args": []
}
]
}
3, vscode已安装插件:go
4,go安装的工具有:
xx@xxMacBook-Pro bin % ls $GOPATH/bin
dlv go-symbols gocomplete golint gopkgs gopls goreturns guru impl
go-outline gocode gogetdoc gomodifytags goplay gorename gotests staticcheck