Golang开发手册
Golang的应用领域
- 区块链研发工程师BT:去中心化
- Go服务器端/游戏软件工程师=>数据处理、处理大并发能力 基于网络的中间件
-
Go的设计思想
Go vs Java
指针
- 函数
- 并发:Go routine协程
- Goroutine的GPM模型
Vscode中配置自动导包
ctrl+shift+P,键入go:install/update tools,勾选所有插件 ``` Installing 16 tools at /Users/maiyang/develop/goworkspace//bin gocode gopkgs go-outline go-symbols guru gorename dlv godef godoc goreturns golint gotests gomodifytags impl fillstruct goplay
Installing github.com/mdempsky/gocode SUCCEEDED Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED Installing github.com/ramya-rao-a/go-outline SUCCEEDED Installing github.com/acroca/go-symbols SUCCEEDED Installing golang.org/x/tools/cmd/guru SUCCEEDED Installing golang.org/x/tools/cmd/gorename SUCCEEDED Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED Installing github.com/rogpeppe/godef SUCCEEDED Installing golang.org/x/tools/cmd/godoc SUCCEEDED Installing github.com/sqs/goreturns SUCCEEDED Installing github.com/golang/lint/golint SUCCEEDED Installing github.com/cweill/gotests/… SUCCEEDED Installing github.com/fatih/gomodifytags SUCCEEDED Installing github.com/josharian/impl SUCCEEDED Installing github.com/davidrjenni/reftools/cmd/fillstruct SUCCEEDED Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED
All tools successfully installed. You’re ready to Go :).
修改默认配置:<br />Setting-搜索框输入go<br /><br />在settings.json中添加如下配置
“go.goroot”: “”,
“go.gopath”: “”,
“go.inferGopath”: true,
“go.autocompleteUnimportedPackages”: true,
“go.gocodePackageLookupMode”: “go”,
“go.gotoSymbol.includeImports”: true,
“go.useCodeSnippetsOnFunctionSuggest”: true,
“go.useCodeSnippetsOnFunctionSuggestWithoutType”: true,
“go.docsTool”: “gogetdoc”,
```
ctrl+shift+p install/update go tools安装不成功执行下面两句
Vscode无法跳转内置函数查看源码问题
OpenSettings—关闭Go: Use Language Server
Go:Docs Tool选择guru
VSCode无法Debug问题
go中一个文件夹下面只能由一个package不然多个package,一个package只能由一个main函数,所以调试的最好做法就是创建不同的文件夹然后package main main()这样单独文件夹调试。