Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fieldpath/fromvalue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cli
import (
"bytes"
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
"testing"
)
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"

"sigs.k8s.io/structured-merge-diff/v6/typed"
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/testdata/bad-scalar.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
types:
- name: scalar
scalar: numeric
- name: scalar
scalar: numeric
4 changes: 2 additions & 2 deletions internal/testdata/scalar.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
types:
- name: scalar
scalar: string
- name: scalar
scalar: string
2 changes: 1 addition & 1 deletion merge/multiple_appliers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions merge/real_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package merge_test

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion typed/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
8 changes: 4 additions & 4 deletions typed/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions value/equals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion value/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

jsoniter "github.com/json-iterator/go"

yaml "go.yaml.in/yaml/v2"
yaml "go.yaml.in/yaml/v3"
)

var (
Expand Down