Skip to content

Commit 9d999ed

Browse files
committed
fine grained context logs
1 parent 526acc1 commit 9d999ed

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

testing/it_sidecar/it_sidecar.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,8 @@ func main() {
415415

416416
fmt.Println("READY")
417417
<-ctx.Done()
418-
switch ctx.Err() {
419-
case context.DeadlineExceeded:
420-
log.Print("Deadline exceeded")
421-
case context.Canceled:
422-
log.Print("Context Canceled")
423-
default:
424-
log.Print(ctx.Err())
418+
if cause := context.Cause(ctx); cause != nil {
419+
log.Print("ctx.Done: ", cause.Error())
425420
}
426421

427422
}

0 commit comments

Comments
 (0)