diff --git a/fieldpath/fromvalue_test.go b/fieldpath/fromvalue_test.go index cd909a50..7b20e797 100644 --- a/fieldpath/fromvalue_test.go +++ b/fieldpath/fromvalue_test.go @@ -19,7 +19,7 @@ package fieldpath import ( "testing" - yaml "go.yaml.in/yaml/v2" + yaml "go.yaml.in/yaml/v3" "sigs.k8s.io/structured-merge-diff/v6/value" ) diff --git a/go.mod b/go.mod index f5343b69..0bebd200 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module sigs.k8s.io/structured-merge-diff/v6 require ( github.com/google/go-cmp v0.5.9 github.com/json-iterator/go v1.1.12 - go.yaml.in/yaml/v2 v2.4.2 + go.yaml.in/yaml/v3 v3.0.4 sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016 ) diff --git a/go.sum b/go.sum index e120aad1..7f827dc1 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= -go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016 h1:kXv6kKdoEtedwuqMmkqhbkgvYKeycVbC8+iPCP9j5kQ= diff --git a/internal/cli/main_test.go b/internal/cli/main_test.go index 3e409ede..0b26f7df 100644 --- a/internal/cli/main_test.go +++ b/internal/cli/main_test.go @@ -19,7 +19,7 @@ package cli import ( "bytes" "encoding/json" - "io/ioutil" + "os" "path/filepath" "testing" ) @@ -130,7 +130,7 @@ func (tt *testCase) checkOutput(t *testing.T, got []byte) { if tt.expectedOutputPath == "" { return } - want, err := ioutil.ReadFile(tt.expectedOutputPath) + want, err := os.ReadFile(tt.expectedOutputPath) if err != nil { t.Fatalf("couldn't read expected output %q: %v", tt.expectedOutputPath, err) } diff --git a/internal/cli/operation.go b/internal/cli/operation.go index e80d5383..374b847e 100644 --- a/internal/cli/operation.go +++ b/internal/cli/operation.go @@ -19,7 +19,7 @@ package cli import ( "fmt" "io" - "io/ioutil" + "os" "sigs.k8s.io/structured-merge-diff/v6/typed" "sigs.k8s.io/structured-merge-diff/v6/value" @@ -35,7 +35,7 @@ type operationBase struct { } func (b operationBase) parseFile(path string) (tv *typed.TypedValue, err error) { - bytes, err := ioutil.ReadFile(path) + bytes, err := os.ReadFile(path) if err != nil { return tv, fmt.Errorf("unable to read file %q: %v", path, err) } diff --git a/internal/cli/options.go b/internal/cli/options.go index 66626ffd..9a439aaa 100644 --- a/internal/cli/options.go +++ b/internal/cli/options.go @@ -21,7 +21,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "os" "sigs.k8s.io/structured-merge-diff/v6/typed" @@ -76,7 +75,7 @@ func (o *Options) Resolve() (Operation, error) { if o.schemaPath == "" { return nil, errors.New("a schema is required") } - b, err := ioutil.ReadFile(o.schemaPath) + b, err := os.ReadFile(o.schemaPath) if err != nil { return nil, fmt.Errorf("unable to read schema %q: %v", o.schemaPath, err) } diff --git a/internal/testdata/bad-scalar.yaml b/internal/testdata/bad-scalar.yaml index 036a5a77..8be122e5 100644 --- a/internal/testdata/bad-scalar.yaml +++ b/internal/testdata/bad-scalar.yaml @@ -1,3 +1,3 @@ types: -- name: scalar - scalar: numeric + - name: scalar + scalar: numeric diff --git a/internal/testdata/scalar.yaml b/internal/testdata/scalar.yaml index 28af7929..f0744cfc 100644 --- a/internal/testdata/scalar.yaml +++ b/internal/testdata/scalar.yaml @@ -1,3 +1,3 @@ types: -- name: scalar - scalar: string + - name: scalar + scalar: string diff --git a/merge/multiple_appliers_test.go b/merge/multiple_appliers_test.go index 7fad7b15..f7b90d4b 100644 --- a/merge/multiple_appliers_test.go +++ b/merge/multiple_appliers_test.go @@ -22,7 +22,7 @@ import ( "strings" "testing" - yaml "go.yaml.in/yaml/v2" + yaml "go.yaml.in/yaml/v3" "sigs.k8s.io/structured-merge-diff/v6/fieldpath" . "sigs.k8s.io/structured-merge-diff/v6/internal/fixture" "sigs.k8s.io/structured-merge-diff/v6/merge" diff --git a/merge/real_test.go b/merge/real_test.go index c8254fce..dc518f03 100644 --- a/merge/real_test.go +++ b/merge/real_test.go @@ -17,7 +17,7 @@ limitations under the License. package merge_test import ( - "io/ioutil" + "os" "path/filepath" "testing" @@ -30,7 +30,7 @@ func testdata(file string) string { } func read(file string) []byte { - s, err := ioutil.ReadFile(file) + s, err := os.ReadFile(file) if err != nil { panic(err) } diff --git a/typed/parser.go b/typed/parser.go index c46e69f2..daea57a5 100644 --- a/typed/parser.go +++ b/typed/parser.go @@ -19,7 +19,7 @@ package typed import ( "fmt" - yaml "go.yaml.in/yaml/v2" + yaml "go.yaml.in/yaml/v3" "sigs.k8s.io/structured-merge-diff/v6/schema" "sigs.k8s.io/structured-merge-diff/v6/value" ) diff --git a/typed/parser_test.go b/typed/parser_test.go index 9ef51cb6..862d0849 100644 --- a/typed/parser_test.go +++ b/typed/parser_test.go @@ -17,12 +17,12 @@ limitations under the License. package typed_test import ( - "io/ioutil" + "os" "path/filepath" "strings" "testing" - yaml "go.yaml.in/yaml/v2" + yaml "go.yaml.in/yaml/v3" "sigs.k8s.io/structured-merge-diff/v6/typed" ) @@ -31,7 +31,7 @@ func testdata(file string) string { } func read(file string) []byte { - obj, err := ioutil.ReadFile(file) + obj, err := os.ReadFile(file) if err != nil { panic(err) } @@ -65,7 +65,7 @@ func BenchmarkConvertUnstructured(b *testing.B) { }, } - s, err := ioutil.ReadFile(testdata("k8s-schema.yaml")) + s, err := os.ReadFile(testdata("k8s-schema.yaml")) if err != nil { b.Fatal(err) } diff --git a/value/equals_test.go b/value/equals_test.go index ecfc7d03..b1d77ef8 100644 --- a/value/equals_test.go +++ b/value/equals_test.go @@ -17,11 +17,11 @@ limitations under the License. package value_test import ( - "io/ioutil" + "os" "path/filepath" "testing" - yaml "go.yaml.in/yaml/v2" + yaml "go.yaml.in/yaml/v3" "sigs.k8s.io/structured-merge-diff/v6/value" ) @@ -30,7 +30,7 @@ func testdata(file string) string { } func read(file string) []byte { - s, err := ioutil.ReadFile(file) + s, err := os.ReadFile(file) if err != nil { panic(err) } diff --git a/value/value.go b/value/value.go index 140b9903..e024a6c4 100644 --- a/value/value.go +++ b/value/value.go @@ -24,7 +24,7 @@ import ( jsoniter "github.com/json-iterator/go" - yaml "go.yaml.in/yaml/v2" + yaml "go.yaml.in/yaml/v3" ) var (