diff --git a/go.mod b/go.mod index dd2eb39..01a69fe 100644 --- a/go.mod +++ b/go.mod @@ -2,13 +2,9 @@ module github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go go 1.21 -require ( - github.com/hashicorp/go-multierror v1.1.1 - github.com/xeipuuv/gojsonschema v1.2.0 -) +require github.com/xeipuuv/gojsonschema v1.2.0 require ( - github.com/hashicorp/errwrap v1.0.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect ) diff --git a/go.sum b/go.sum index ce09816..ebda4ab 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/json_schema.go b/json_schema.go index 1c01c9a..265baac 100644 --- a/json_schema.go +++ b/json_schema.go @@ -4,11 +4,11 @@ package cfschema import ( + "errors" "fmt" "os" "path/filepath" - "github.com/hashicorp/go-multierror" "github.com/xeipuuv/gojsonschema" ) @@ -44,17 +44,17 @@ func (s *jsonSchema) validate(loader gojsonschema.JSONLoader) error { result, err := s.schema.Validate(loader) if err != nil { - return fmt.Errorf("Unable to Validate JSON Schema: %w", err) + return fmt.Errorf("validating JSON Schema: %w", err) } if !result.Valid() { - var errs *multierror.Error + var errs []error for _, resultError := range result.Errors() { - errs = multierror.Append(errs, fmt.Errorf("%s", resultError.String())) + errs = append(errs, errors.New(resultError.String())) } - return fmt.Errorf("Validation Errors: %w", errs) + return fmt.Errorf("validation errors: %w", errors.Join(errs...)) } return nil