From 086ee1dadc338060436d00502dbaf84ef245302b Mon Sep 17 00:00:00 2001 From: Christian Ege Date: Fri, 14 Jun 2024 08:55:39 +0200 Subject: [PATCH] ci: fix a go-cilinter finding about not handled error --- pkg/swupdater/swupdater.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/swupdater/swupdater.go b/pkg/swupdater/swupdater.go index a0dafc1..0e228a2 100644 --- a/pkg/swupdater/swupdater.go +++ b/pkg/swupdater/swupdater.go @@ -55,7 +55,10 @@ func (s *SWUpdater) upload(filename string) error { } ms := multipartstreamer.New() - ms.WriteReader(fieldname, filename, fileInfo.Size(), file) + err = ms.WriteReader(fieldname, filename, fileInfo.Size(), file) + if err != nil { + return fmt.Errorf("cannot write reader: %w", err) + } req, _ := http.NewRequest("POST", s.urlUpload, nil) ms.SetupRequest(req)