社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
我所处的环境
https://golang.org
国内无法打开的,原因都懂。https://studygolang.com
Go语言中文网。版本不会最新。https://go-zh.org/doc/install
Go语言中文镜像站(这个网站无法下载,我也搞不懂)。bin
、src
、pkg
都一起搬到变更后的地方,因为一些工具如格式化代码,都会存放在bin目录下,如果不一起迁移的话补全,格式化都是没用了,又需要重新下载。)D:gobin
是我安装go的路径)https://goproxy.cn
或者https://goproxy.io
,我一般用cn的。bin
目录里面,有时候vscode兼容问题也要看这里的exe。git clone https://github.com/a/x.git
go install github.com/a/x
安装即可。(第三方包也可以这样安装){
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "LaunchGO",
"type": "go",
"request": "launch",
"mode": "auto",
"remotePath": "",
"port": 5546,
"host": "127.0.0.1",
"program": "${fileDirname}",
"env": {
"GOPATH":"C:/Users/kernel/go",
"GOROOT":"D:/go"
},
"args": []
}
]
}
ctrl + ,
打开配置。{
"editor.wordwrap":"on",
"editor.minimap.renderCharacters": false,
"editor.minimap.enabled": false,
"terminal.external.osxExec": "iTerm.app",
"go.docsTool": "gogetdoc",
"go.testFlags": ["-v","-count=1"],
"go.buildTags": "",
"go.lintFlags": [],
"go.vetFlags": [],
"go.coverOnSave": false,
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.formatTool": "goreturns",
//"go.formatTool": "goimports",
"go.goroot":"D:\Go\",
"go.gopath":"C:\Users\kernel\go",
"go.autocompleteUnimportedPackages": true,
"go.formatOnSave":true,
"window.zoomLevel": 0,
"debug.console.fontSize": 16,
"debug.console.lineHeight": 30,
"git.path": "D:\Program Files\Git\bin\git.exe",
"terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe",
"workbench.statusBar.visible": true,
"files.autoSaveDelay": 30000,
"explorer.confirmDelete": false,
//"editor.suggest.snippetsPreventQuickSuggestions": false,
//"go.useLanguageServer": true
//"http.proxy": "http://127.0.0.1:1080",
//"go.inferGopath": true
// "[javascript]":{
// "editor.defaultFormatter": "HookyQR.beautify"
// },
// "[html]":{
// "editor.defaultFormatter": "HookyQR.beautify"
// //"editor.suggest.insertMode": "replace"
// },
}
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!