
Go
努力的coder
坚持,为了梦想,一步又一步地往前走。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
go协程顺序输出
func main(){ chs := [11]chan struct{}{} for i := 0; i < 10; i ++ { chs[i] = make(chan struct{}) go func(i int) { //从通道中取出元素,才往下执行,否则一直阻塞等待 <- chs[i] fmt.Println(i) chs[i+1] <- struct{}{} }(i) } //确保主协程能对chs[0]附上值 chs[...原创 2020-05-24 19:17:26 · 930 阅读 · 0 评论 -
Go语言grpc proto生成pb文件
安装:# git clone https://github.com/grpc/grpc-go.git $GOPATH/pkg/mod/google.golang.org/grpc# git clone https://github.com/golang/net.git $GOPATH/pkg/mod/golang.org/x/netgit clone https://github.com/...原创 2020-05-02 22:50:02 · 3068 阅读 · 0 评论