Ai
61 Star 659 Fork 311

ShirDon-廖显东/Go Web编程实战派源码

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
chan3.go 774 Bytes
Copy Edit Raw Blame History
ShirDon-廖显东 authored 2021-01-19 21:25 +08:00 . commit
//++++++++++++++++++++++++++++++++++++++++
// 《Go Web编程实战派从入门到精通》源码
//++++++++++++++++++++++++++++++++++++++++
// Author:廖显东(ShirDon)
// Blog:https://www.shirdon.com/
// 仓库地址:https://gitee.com/shirdonl/goWebActualCombat
// 仓库地址:https://github.com/shirdonl/goWebActualCombat
//++++++++++++++++++++++++++++++++++++++++
package main
import "fmt"
func main() {
// 这里我们定义了一个可以存储整数类型的带缓冲通道,缓冲区大小为3
ch := make(chan int, 3)
// 因为 ch 是带缓冲的通道,我们可以同时发送两个数据
// 而不用立刻需要去同步读取数据
ch <- 6
ch <- 7
ch <- 8
// 获取这三个数据
fmt.Println(<-ch)
fmt.Println(<-ch)
fmt.Println(<-ch)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/shirdonl/goWebActualCombat.git
git@gitee.com:shirdonl/goWebActualCombat.git
shirdonl
goWebActualCombat
Go Web编程实战派源码
11434bb9048a

Search