Skip to content

Commit

Permalink
Do not import github.com/google/go-cmp/cmp outside tests.
Browse files Browse the repository at this point in the history
Go-cmp relies heavily on reflection in ways that casue the golang
compiler to disable the dead code elimination. Even declaring a
variable of type cmp.Option disables the DCE.

fuzz.go is only used in tests, but is placed in the package itself.
This disables the DCE in every user of k8s.io/client-go. Move it to
fuzz_test.go instead.
  • Loading branch information
dominiquelefevre committed Sep 20, 2023
1 parent 68afd61 commit b017e20
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 1 deletion.
File renamed without changes.
1 change: 0 additions & 1 deletion test/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down

0 comments on commit b017e20

Please sign in to comment.