Skip to content

Commit

Permalink
Linter to ensure go-cmp/cmp is used ONLY in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4e05bc20db99ff89b2d2205218d24b9935a7fdd7
  • Loading branch information
dims authored and k8s-publishing-bot committed Jan 24, 2025
1 parent 45d29dc commit d5dedd0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/api/apitesting/roundtrip/compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"strings"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp" //nolint:depguard

apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/apitesting/roundtrip/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp" //nolint:depguard
fuzz "github.com/google/gofuzz"
flag "github.com/spf13/pflag"

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/apitesting/roundtrip/unstructured.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
jsonserializer "k8s.io/apimachinery/pkg/runtime/serializer/json"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp" //nolint:depguard
)

// RoundtripToUnstructured verifies the roundtrip faithfulness of all external types in a scheme
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"text/tabwriter"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp" //nolint:depguard
"k8s.io/apimachinery/pkg/util/dump"
)

Expand Down

0 comments on commit d5dedd0

Please sign in to comment.