```
// Waits for a random time between two durations and sends the current time on
// the returned channel.
func afterBetween(min time.Duration, max time.Duration) <-chan time.Time {
rand := rand.New(rand.NewSource(time.Now().UnixNano()))
d, delta := min, (max - min)
if delta > 0 {
d += time.Duration(rand.Int63n(int64(delta)))
}
return time.After(d) ///After是标准库里的, 返回的是bool
}
```
上面的time.After(d)和 <-chan time.Time 怎么匹配的?
有疑问加站长微信联系(非本文作者)