diff --git a/controllers/goharbor/harbor/harbor_suite_test.go b/controllers/goharbor/harbor/harbor_suite_test.go index 7ab3def5d..2b33a1bf1 100644 --- a/controllers/goharbor/harbor/harbor_suite_test.go +++ b/controllers/goharbor/harbor/harbor_suite_test.go @@ -2,7 +2,7 @@ package harbor_test import ( "context" - "io/ioutil" + "os" "strings" "testing" @@ -24,7 +24,7 @@ func TestHarbor(t *testing.T) { } func fileString(filePath string) string { - content, err := ioutil.ReadFile(filePath) + content, err := os.ReadFile(filePath) Expect(err).NotTo(HaveOccurred()) return strings.TrimSpace(string(content)) diff --git a/pkg/controller/template.go b/pkg/controller/template.go index 3bfd6e272..e324d171f 100644 --- a/pkg/controller/template.go +++ b/pkg/controller/template.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "text/template" "github.com/Masterminds/sprig" @@ -48,7 +47,7 @@ func (c *Controller) GetTemplatedConfig(ctx context.Context, templateConfig stri errTemplate = t.Execute(writer, owner) }() - configContent, err := ioutil.ReadAll(reader) + configContent, err := io.ReadAll(reader) if errTemplate != nil { if errors.As(err, &template.ExecError{}) {