Fix golangci-lint errors

that appeared due to the new version v1.53.1.
This commit is contained in:
Maximilian Paß
2023-06-03 17:06:41 +01:00
parent 6ad6283352
commit 5b64725faa
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)