diff --git a/v2/glauth.go b/v2/glauth.go index 1e24b39..9daed0e 100644 --- a/v2/glauth.go +++ b/v2/glauth.go @@ -17,7 +17,6 @@ import ( "github.com/rs/zerolog" "gopkg.in/amz.v3/aws" "gopkg.in/amz.v3/s3" - "io/ioutil" "net/http" "os" "path/filepath" @@ -328,11 +327,11 @@ func parseConfigFile(configFileLocation string) (*config.Config, error) { } */ - files, _ := ioutil.ReadDir(configFileLocation) + files, _ := os.ReadDir(configFileLocation) for _, f := range files { canonicalName := filepath.Join(configFileLocation, f.Name()) - bs, _ := ioutil.ReadFile(canonicalName) + bs, _ := os.ReadFile(canonicalName) var curRawCfgStruct interface{} if err := toml.Unmarshal(bs, &curRawCfgStruct); err != nil { return &cfg, err diff --git a/v2/pkg/frontend/webapi.go b/v2/pkg/frontend/webapi.go index d369db8..9aa9162 100644 --- a/v2/pkg/frontend/webapi.go +++ b/v2/pkg/frontend/webapi.go @@ -6,7 +6,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/rs/zerolog" - "io/ioutil" + "io" "log" "net/http" "regexp" @@ -100,7 +100,7 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) { return } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { log.Printf("Error reading body of %q: %v", c.url, err) return diff --git a/v2/pkg/handler/ldapopshelper.go b/v2/pkg/handler/ldapopshelper.go index 083047f..8c159e7 100644 --- a/v2/pkg/handler/ldapopshelper.go +++ b/v2/pkg/handler/ldapopshelper.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "fmt" "github.com/rs/zerolog" - "io/ioutil" "net" "os" "path/filepath" @@ -371,7 +370,7 @@ func (l LDAPOpsHelper) searchMaybeSchemaQuery(h LDAPOpsHandler, baseDN string, s attrs = append(attrs, &ldap.EntryAttribute{Name: "modifiersName", Values: []string{"cn=Directory Manager"}}) attrs = append(attrs, &ldap.EntryAttribute{Name: "modifyTimeStamp", Values: []string{"Mar 8, 2021, 12:46:29 PM PST (20210308204629Z)"}}) // Iterate through schema attributes provided in schema/ directory - filenames, _ := ioutil.ReadDir("schema") + filenames, _ := os.ReadDir("schema") for _, filename := range filenames { attributename := new(string) *attributename = filename.Name() diff --git a/v2/pkg/handler/owncloud.go b/v2/pkg/handler/owncloud.go index d763283..318de98 100644 --- a/v2/pkg/handler/owncloud.go +++ b/v2/pkg/handler/owncloud.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" "github.com/rs/zerolog" - "io/ioutil" + "io" "net" "net/http" "strings" @@ -255,7 +255,7 @@ func (s ownCloudSession) getGroups() ([]msgraph.Group, error) { return nil, err } defer resp.Body.Close() - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) if err != nil { return nil, err } @@ -326,7 +326,7 @@ func (s ownCloudSession) getUsers(userName string) ([]msgraph.User, error) { return nil, err } defer resp.Body.Close() - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) if err != nil { return nil, err }