我想知道<-Go 中函数的通道返回类型是什么意思。实际上,类型 T 的通道是使用 编写chan T和创建的make(chan T, N),那么“ <-”在 的返回类型中是什么意思time.After?
go doc time.After
package time // import "time"
func After(d Duration) <-chan Time
After waits for the duration to elapse and then sends the current time on
the returned channel. It is equivalent to NewTimer(d).C. The underlying
Timer is not recovered by the garbage collector until the timer fires. If
efficiency is a concern, use NewTimer instead and call Timer.Stop if the
timer is no longer needed.
奖金:
我如何从中go doc看出time.After是异步的并且在持续时间过去之前不会阻塞?
呼如林
慕的地10843
随时随地看视频慕课网APP
相关分类