mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 04:15:54 +02:00
golangci-lint 1.49 and related fixes (#1736)
This commit is contained in:
parent
faf3670e7f
commit
414282a2c9
42 changed files with 140 additions and 158 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue