Fix context warnings from govet. (#1486)

Pre-req work for #1484
This commit is contained in:
dfawley
2017-08-29 11:04:15 -07:00
committed by GitHub
parent 7fd9c2c66f
commit e60698345e
5 changed files with 58 additions and 32 deletions

View File

@ -284,10 +284,12 @@ func TestGetOnWaitChannel(t *testing.T) {
r.w.inject(updates)
for {
var reply string
ctx, _ := context.WithTimeout(context.Background(), 10*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)
if err := Invoke(ctx, "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); Code(err) == codes.DeadlineExceeded {
cancel()
break
}
cancel()
time.Sleep(10 * time.Millisecond)
}
var wg sync.WaitGroup