remove direct dependency on github/pkg/errors (#4970)

This commit is contained in:
Cailyn
2023-01-13 13:52:25 -05:00
committed by GitHub
parent 2b7eb6d92a
commit 8ab4b8d167
38 changed files with 137 additions and 143 deletions

View File

@@ -6,7 +6,7 @@ package types
import (
"fmt"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/kyaml/errors"
)
type errOnlyBuiltinPluginsAllowed struct {
@@ -24,10 +24,6 @@ func NewErrOnlyBuiltinPluginsAllowed(n string) *errOnlyBuiltinPluginsAllowed {
}
func IsErrOnlyBuiltinPluginsAllowed(err error) bool {
_, ok := err.(*errOnlyBuiltinPluginsAllowed)
if ok {
return true
}
_, ok = errors.Cause(err).(*errOnlyBuiltinPluginsAllowed)
return ok
e := &errOnlyBuiltinPluginsAllowed{}
return errors.As(err, &e)
}

View File

@@ -7,7 +7,7 @@ import (
"fmt"
"strings"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/kyaml/errors"
)
type errUnableToFind struct {
@@ -31,10 +31,6 @@ func NewErrUnableToFind(w string, a []Pair) *errUnableToFind {
}
func IsErrUnableToFind(err error) bool {
_, ok := err.(*errUnableToFind)
if ok {
return true
}
_, ok = errors.Cause(err).(*errUnableToFind)
return ok
e := &errUnableToFind{}
return errors.As(err, &e)
}