我想知道<-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是异步的并且在持续时间过去之前不会阻塞?
忽然笑
相关分类