From 6f0af1697f1efcf70504c0f9b0b1fea5a011164d Mon Sep 17 00:00:00 2001 From: robinbraemer Date: Wed, 16 Feb 2022 22:41:58 +0100 Subject: [PATCH] use context.WithDeadline instead; update googleapis --- api/buf.lock | 6 +++--- deadline.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/buf.lock b/api/buf.lock index 1a1fe87..6f9367b 100644 --- a/api/buf.lock +++ b/api/buf.lock @@ -5,6 +5,6 @@ deps: owner: googleapis repository: googleapis branch: main - commit: 287d292a82ac42bf89fa460852beb95a - digest: b1-sdZITubeC1wjF5xGyHJjL1Uv7nvjlgPmQYKdfwMecX4= - create_time: 2022-02-01T15:10:56.701418Z + commit: 7cc90235b0b34a33961f2d27162fbfb7 + digest: b1-7aR1G7jkTCelrf6_GT5R5Y98Qn4OGNiqntQyrbZGTio= + create_time: 2022-02-16T15:20:23.829328Z diff --git a/deadline.go b/deadline.go index 6b695ab..f07558c 100644 --- a/deadline.go +++ b/deadline.go @@ -21,7 +21,7 @@ func (d *deadline) SetDeadline(t time.Time) error { d.timeout = context.Background() } if !t.IsZero() { - d.timeout, d.timeoutCancel = context.WithTimeout(context.Background(), time.Until(t)) + d.timeout, d.timeoutCancel = context.WithDeadline(context.Background(), t) } return nil }