golangci-lint 1.49 and related fixes (#1736)

This commit is contained in:
mmetc 2022-09-06 13:55:03 +02:00 committed by GitHub
parent faf3670e7f
commit 414282a2c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 140 additions and 158 deletions

View file

@ -5,7 +5,7 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"strings"
@ -71,13 +71,13 @@ func (s *Splunk) Notify(ctx context.Context, notification *protobufs.Notificatio
}
if resp.StatusCode != 200 {
content, err := ioutil.ReadAll(resp.Body)
content, err := io.ReadAll(resp.Body)
if err != nil {
return &protobufs.Empty{}, fmt.Errorf("got non 200 response and failed to read error %s", err)
}
return &protobufs.Empty{}, fmt.Errorf("got non 200 response %s", string(content))
}
respData, err := ioutil.ReadAll(resp.Body)
respData, err := io.ReadAll(resp.Body)
if err != nil {
return &protobufs.Empty{}, fmt.Errorf("failed to read response body got error %s", err)
}