From 5b64725faa4ebaaa319c026b3bc5c021278c701f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Sat, 3 Jun 2023 17:06:41 +0100 Subject: [PATCH] Fix golangci-lint errors that appeared due to the new version v1.53.1. --- pkg/util/util.go | 2 +- tests/helpers/test_helpers.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/util.go b/pkg/util/util.go index ed3f736..08e57e5 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -18,7 +18,7 @@ func RetryExponentialAttempts(attempts int, sleep time.Duration, f func() error) for i := 0; i < attempts; i++ { err = f() if err == nil { - return + return nil } else { log.WithField("count", i).WithError(err).Debug("retrying after error") time.Sleep(sleep) diff --git a/tests/helpers/test_helpers.go b/tests/helpers/test_helpers.go index a6aa370..9b767b1 100644 --- a/tests/helpers/test_helpers.go +++ b/tests/helpers/test_helpers.go @@ -70,7 +70,7 @@ func ReceiveAllWebSocketMessages(connection *websocket.Conn) (messages []*dto.We var message *dto.WebSocketMessage message, err = ReceiveNextWebSocketMessage(connection) if err != nil { - return + return messages, err } messages = append(messages, message) } @@ -175,7 +175,7 @@ func HTTPPut(url string, body io.Reader) (response *http.Response, err error) { func HTTPPutJSON(url string, body interface{}) (response *http.Response, err error) { requestByteString, err := json.Marshal(body) if err != nil { - return + return nil, fmt.Errorf("cannot marshal json http body: %w", err) } reader := bytes.NewReader(requestByteString) return HTTPPut(url, reader)