Merge pull request #491 from lpxxn/master

loop goroutines need pass the variable as a parameter to the anonymous function
This commit is contained in:
Asim Aslam 2019-05-31 10:33:44 +01:00 committed by GitHub
commit 66e02d4ab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,10 +467,10 @@ func (r *rpcClient) Stream(ctx context.Context, request Request, opts ...CallOpt
var grr error
for i := 0; i <= callOpts.Retries; i++ {
go func() {
go func(i int) {
s, err := call(i)
ch <- response{s, err}
}()
}(i)
select {
case <-ctx.Done():