i want use the same channel of time.After for waiting some response timeout.
but when i reuse the channel to read ,it blocks the current goroutine.
Now ,i use another way to solve the problem.
latch := make(chan time.Time, 1)
t := time.AfterFunc(timeout, func() {
close(latch)
})
defer t.Stop()
tch := (<-chan time.Time)(latch)
//wating for response
for g, f := range self.futures {
resp, err := f.Get(tch)
}