From 61196f30791d389c5896e47e673a01cdf402af4c Mon Sep 17 00:00:00 2001 From: Martin Thielecke Date: Thu, 5 Oct 2023 16:16:04 +0200 Subject: [PATCH] error check --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 0d7e26b..bf12d8e 100644 --- a/main.go +++ b/main.go @@ -52,7 +52,9 @@ func main() { logrus.WithError(err).Fatal("error reading credential") } - setOutput(o, s) + if err := setOutput(o, s); err != nil { + logrus.WithError(err).WithField("key", o).Fatal("error setting output") + } } } @@ -151,7 +153,7 @@ func setOutput(k, v string) (err error) { } }() - if _, err := f.Write([]byte(msg)); err != nil { + if _, err = f.Write([]byte(msg)); err != nil { return errors.Wrap(err, "write to output") }