From 8cd17addbe8a8226697f23308695ad9d759726ae Mon Sep 17 00:00:00 2001 From: Michal Horejsek Date: Wed, 13 Jan 2021 08:22:05 +0000 Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s) --- pkg/pmapi/attachments.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/pmapi/attachments.go b/pkg/pmapi/attachments.go index bbf2613b..00ca6e9a 100644 --- a/pkg/pmapi/attachments.go +++ b/pkg/pmapi/attachments.go @@ -186,8 +186,8 @@ func (c *client) CreateAttachment(att *Attachment, r io.Reader, sig io.Reader) ( } cx, cancel := context.WithCancel(req.Context()) - req = req.WithContext(cx) defer cancel() + req = req.WithContext(cx) // We will write the request as long as it is sent to the API. var res CreateAttachmentRes