diff --git a/schema/loader.go b/schema/loader.go index d6da9d89f..d7737582c 100644 --- a/schema/loader.go +++ b/schema/loader.go @@ -19,7 +19,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "strings" @@ -68,7 +67,7 @@ func (factory *fsLoaderFactory) refContents(ref gojsonreference.JsonReference) ( } defer f.Close() - return ioutil.ReadAll(f) + return io.ReadAll(f) } // fsLoader implements gojsonschema.JSONLoader by reading the document named by source from a fsLoaderFactory. diff --git a/schema/spec_test.go b/schema/spec_test.go index dd3295e37..e8dde99f0 100644 --- a/schema/spec_test.go +++ b/schema/spec_test.go @@ -18,7 +18,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "net/url" "os" "path/filepath" @@ -183,7 +182,7 @@ func parseExample(lang, body string) (e example) { } func extractExamples(rd io.Reader) ([]example, error) { - p, err := ioutil.ReadAll(rd) + p, err := io.ReadAll(rd) if err != nil { return nil, err } diff --git a/schema/validator.go b/schema/validator.go index bc7568a34..e219d38c2 100644 --- a/schema/validator.go +++ b/schema/validator.go @@ -19,7 +19,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "regexp" digest "github.com/opencontainers/go-digest" @@ -52,7 +51,7 @@ func (e ValidationError) Error() string { // Validate validates the given reader against the schema of the wrapped media type. func (v Validator) Validate(src io.Reader) error { - buf, err := ioutil.ReadAll(src) + buf, err := io.ReadAll(src) if err != nil { return errors.Wrap(err, "unable to read the document file") } @@ -100,7 +99,7 @@ func (v unimplemented) Validate(src io.Reader) error { func validateManifest(r io.Reader) error { header := v1.Manifest{} - buf, err := ioutil.ReadAll(r) + buf, err := io.ReadAll(r) if err != nil { return errors.Wrapf(err, "error reading the io stream") } @@ -130,7 +129,7 @@ func validateManifest(r io.Reader) error { func validateDescriptor(r io.Reader) error { header := v1.Descriptor{} - buf, err := ioutil.ReadAll(r) + buf, err := io.ReadAll(r) if err != nil { return errors.Wrapf(err, "error reading the io stream") } @@ -152,7 +151,7 @@ func validateDescriptor(r io.Reader) error { func validateIndex(r io.Reader) error { header := v1.Index{} - buf, err := ioutil.ReadAll(r) + buf, err := io.ReadAll(r) if err != nil { return errors.Wrapf(err, "error reading the io stream") } @@ -179,7 +178,7 @@ func validateIndex(r io.Reader) error { func validateConfig(r io.Reader) error { header := v1.Image{} - buf, err := ioutil.ReadAll(r) + buf, err := io.ReadAll(r) if err != nil { return errors.Wrapf(err, "error reading the io stream") }