From db33f06a9510d13a8fe24ca4a641b8f3abeb3b04 Mon Sep 17 00:00:00 2001 From: Harald Albrecht Date: Wed, 7 Sep 2022 20:55:21 +0200 Subject: fixes data race in system.Events and nil error logging Signed-off-by: Harald Albrecht --- pkg/bindings/system/system.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/bindings/system/system.go b/pkg/bindings/system/system.go index dae80384b..733b2cb5c 100644 --- a/pkg/bindings/system/system.go +++ b/pkg/bindings/system/system.go @@ -36,8 +36,9 @@ func Events(ctx context.Context, eventChan chan entities.Event, cancelChan chan if cancelChan != nil { go func() { <-cancelChan - err = response.Body.Close() - logrus.Errorf("Unable to close event response body: %v", err) + if err := response.Body.Close(); err != nil { + logrus.Errorf("Unable to close event response body: %v", err) + } }() } -- cgit v1.2.3-54-g00ecf