فهرست منبع

context: fix small leak introduced by reordering.

LGTM=bcmills
R=bcmills
CC=golang-codereviews
https://golang.org/cl/116420045
Sameer Ajmani 11 سال پیش
والد
کامیت
983e15c919
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      context/context.go

+ 1 - 1
context/context.go

@@ -342,7 +342,7 @@ func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
 	propagateCancel(parent, c)
 	d := deadline.Sub(time.Now())
 	if d <= 0 {
-		c.cancel(false, DeadlineExceeded) // deadline has already passed
+		c.cancel(true, DeadlineExceeded) // deadline has already passed
 		return c, func() { c.cancel(true, Canceled) }
 	}
 	c.mu.Lock()