From b017e203322f320d5dd69a3ae04e2ac777025e28 Mon Sep 17 00:00:00 2001 From: Dominique Lefevre Date: Wed, 20 Sep 2023 19:27:43 +0300 Subject: [PATCH] Do not import github.com/google/go-cmp/cmp outside tests. 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. --- pkg/validation/spec/{fuzz.go => fuzz_test.go} | 0 test/integration/go.mod | 1 - 2 files changed, 1 deletion(-) rename pkg/validation/spec/{fuzz.go => fuzz_test.go} (100%) diff --git a/pkg/validation/spec/fuzz.go b/pkg/validation/spec/fuzz_test.go similarity index 100% rename from pkg/validation/spec/fuzz.go rename to pkg/validation/spec/fuzz_test.go diff --git a/test/integration/go.mod b/test/integration/go.mod index d0c0774bd..2eed3301d 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -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