diff --git a/cmd/knot8/file.go b/cmd/knot8/file.go index 97f925e..173fa60 100644 --- a/cmd/knot8/file.go +++ b/cmd/knot8/file.go @@ -4,6 +4,7 @@ package main import ( + "errors" "fmt" "io" "os" @@ -11,7 +12,6 @@ import ( "sort" "github.com/mattn/go-isatty" - "github.com/mkmik/multierror" "golang.org/x/text/encoding/unicode" "golang.org/x/text/runes" "golang.org/x/text/transform" @@ -103,7 +103,7 @@ func expandPaths(paths []string) ([]string, error) { _ = add(p + "/*.yml") } if errs != nil { - return nil, multierror.Join(errs) + return nil, errors.Join(errs...) } sort.Strings(res) return res, nil diff --git a/cmd/knot8/knobs.go b/cmd/knot8/knobs.go index 5fb7645..6a2df0c 100644 --- a/cmd/knot8/knobs.go +++ b/cmd/knot8/knobs.go @@ -4,11 +4,11 @@ package main import ( + "errors" "fmt" "sort" "strings" - "github.com/mkmik/multierror" "gopkg.in/yaml.v3" "knot8.io/pkg/lensed" ) @@ -53,7 +53,7 @@ func parseFields(manifests []*Manifest) (Fields, error) { } } if errs != nil { - return nil, multierror.Join(errs) + return nil, errors.Join(errs...) } return res, nil } @@ -99,7 +99,7 @@ func (ks Fields) Rebase(dst Manifests) error { } } if errs != nil { - return multierror.Join(errs) + return errors.Join(errs...) } return nil } @@ -166,7 +166,7 @@ func (k Field) GetAll() ([]FieldTarget, error) { res = append(res, FieldTarget{ptr: p, value: v}) } if errs != nil { - return nil, multierror.Join(errs) + return nil, errors.Join(errs...) } return res, nil } @@ -203,7 +203,7 @@ func (b EditBatch) Set(n, v string) error { b.edits[file] = append(b.edits[file], lensed.Mapping{p.Abs(), v}) } if errs != nil { - return multierror.Join(errs) + return errors.Join(errs...) } return nil @@ -220,7 +220,7 @@ func (b EditBatch) Commit() error { } } if errs != nil { - return multierror.Join(errs) + return errors.Join(errs...) } b.committed = true return nil diff --git a/cmd/knot8/main.go b/cmd/knot8/main.go index db39bee..d301944 100644 --- a/cmd/knot8/main.go +++ b/cmd/knot8/main.go @@ -12,7 +12,6 @@ import ( "github.com/alecthomas/kong" "github.com/hashicorp/go-getter" - "github.com/mkmik/multierror" "gopkg.in/yaml.v3" "knot8.io/pkg/lensed" ) @@ -135,7 +134,7 @@ func (s *SetCmd) Run(ctx *Context) error { } } if errs != nil { - return multierror.Join(errs) + return errors.Join(errs...) } if err := batch.Commit(); err != nil { return err @@ -167,7 +166,7 @@ func settersFromFiles(paths []string) ([]Setter, error) { } } if errs != nil { - return nil, multierror.Join(errs) + return nil, errors.Join(errs...) } for k, v := range all { res = append(res, Setter{k, v}) @@ -402,7 +401,7 @@ func checkFields(fields Fields) error { } } if errs != nil { - return errNotUniqueValue{multierror.Join(errs)} + return errNotUniqueValue{errors.Join(errs...)} } return nil } @@ -462,7 +461,7 @@ func openFields(paths []string, schema string) (*ManifestSet, error) { } } if errs != nil { - return nil, multierror.Join(errs) + return nil, errors.Join(errs...) } fields, err = parseFields(manifests) diff --git a/cmd/knot8/manifest.go b/cmd/knot8/manifest.go index 7155276..fc691d2 100644 --- a/cmd/knot8/manifest.go +++ b/cmd/knot8/manifest.go @@ -6,11 +6,11 @@ package main import ( "bytes" "encoding/json" + "errors" "fmt" "io" "strings" - "github.com/mkmik/multierror" "gopkg.in/yaml.v3" ) @@ -112,7 +112,7 @@ func (ms Manifests) Commit() error { } if errs != nil { - return multierror.Join(errs) + return errors.Join(errs...) } return nil } diff --git a/pkg/lensed/yaml.go b/pkg/lensed/yaml.go index 6465fb5..3fb2378 100644 --- a/pkg/lensed/yaml.go +++ b/pkg/lensed/yaml.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/vmware-labs/go-yaml-edit" + yamled "github.com/vmware-labs/go-yaml-edit" "github.com/vmware-labs/go-yaml-edit/splice" yptr "github.com/vmware-labs/yaml-jsonpointer" "golang.org/x/text/transform"