diff --git a/api/response.go b/api/response.go index 2feb821..2cd7821 100644 --- a/api/response.go +++ b/api/response.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" log "github.com/sirupsen/logrus" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -46,7 +46,7 @@ func (c *Client) GetJSONResponse(req *http.Request) (data *ResponseBody, err err } // read response body - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { err = fmt.Errorf("could not retrieve response body: %w", err) return diff --git a/api/sites_test.go b/api/sites_test.go index 8b592dc..0b5bb74 100644 --- a/api/sites_test.go +++ b/api/sites_test.go @@ -3,9 +3,9 @@ package api_test import ( "github.com/jarcoal/httpmock" "github.com/stretchr/testify/assert" - "io/ioutil" "net/http" "net/url" + "os" "testing" ) @@ -15,7 +15,7 @@ func TestClient_GetSites(t *testing.T) { httpmock.RegisterResponder("GET", "https://euce1-test.sentinelone.net/web/api/v2.1/sites", func(req *http.Request) (*http.Response, error) { - data, err := ioutil.ReadFile("testdata/sites.json") + data, err := os.ReadFile("testdata/sites.json") assert.NoError(t, err) return httpmock.NewBytesResponse(200, data), nil diff --git a/api/threats_test.go b/api/threats_test.go index 5373ad8..c3b6624 100644 --- a/api/threats_test.go +++ b/api/threats_test.go @@ -3,9 +3,9 @@ package api_test import ( "github.com/jarcoal/httpmock" "github.com/stretchr/testify/assert" - "io/ioutil" "net/http" "net/url" + "os" "testing" ) @@ -15,7 +15,7 @@ func TestClient_GetThreats(t *testing.T) { httpmock.RegisterResponder("GET", "https://euce1-test.sentinelone.net/web/api/v2.1/threats", func(req *http.Request) (*http.Response, error) { - data, err := ioutil.ReadFile("testdata/threats.json") + data, err := os.ReadFile("testdata/threats.json") assert.NoError(t, err) return httpmock.NewBytesResponse(200, data), nil diff --git a/go.mod b/go.mod index 04c4c83..1631d7e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/NETWAYS/check_sentinelone -go 1.14 +go 1.19 require ( github.com/NETWAYS/go-check v0.0.0-20200808130510-2fe660cfdef9 @@ -10,3 +10,15 @@ require ( github.com/stretchr/testify v1.8.2 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/golang/protobuf v1.4.2 // indirect + github.com/mitchellh/go-ps v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.25.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum index 43dfbd3..dced4cc 100644 --- a/go.sum +++ b/go.sum @@ -113,7 +113,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= -github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=