diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate_test.go index 5e5ed0b34d90..85c5e86a9b9d 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate_test.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate_test.go @@ -383,7 +383,6 @@ func TestUpdateAnnotations(t *testing.T) { func TestAnnotateErrors(t *testing.T) { testCases := map[string]struct { args []string - flags map[string]string errFn func(error) bool }{ "no args": { @@ -430,9 +429,6 @@ func TestAnnotateErrors(t *testing.T) { cmd.SetOut(bufOut) cmd.SetErr(bufOut) - for k, v := range testCase.flags { - cmd.Flags().Set(k, v) - } options := NewAnnotateOptions(iostreams) err := options.Complete(tf, cmd, testCase.args) if err == nil { @@ -443,10 +439,10 @@ func TestAnnotateErrors(t *testing.T) { return } if bufOut.Len() > 0 { - t.Errorf("buffer should be empty: %s", string(bufOut.Bytes())) + t.Errorf("buffer should be empty: %s", bufOut.String()) } if bufErr.Len() > 0 { - t.Errorf("buffer should be empty: %s", string(bufErr.Bytes())) + t.Errorf("buffer should be empty: %s", bufErr.String()) } }) } diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/clusterinfo/clusterinfo_dump_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/clusterinfo/clusterinfo_dump_test.go index d4f150f32dbe..91ebd3bc7356 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/clusterinfo/clusterinfo_dump_test.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/clusterinfo/clusterinfo_dump_test.go @@ -41,7 +41,6 @@ func TestSetupOutputWriterNoOp(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { _, _, buf, _ := genericclioptions.NewTestIOStreams() f := cmdtesting.NewTestFactory() diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/label/label_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/label/label_test.go index c379455c0f47..17e4c5df4259 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/label/label_test.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/label/label_test.go @@ -301,7 +301,6 @@ func TestLabelFunc(t *testing.T) { func TestLabelErrors(t *testing.T) { testCases := map[string]struct { args []string - flags map[string]string errFn func(error) bool }{ "no args": { @@ -355,9 +354,6 @@ func TestLabelErrors(t *testing.T) { cmd.SetOut(buf) cmd.SetErr(buf) - for k, v := range testCase.flags { - cmd.Flags().Set(k, v) - } opts := NewLabelOptions(ioStreams) err := opts.Complete(tf, cmd, testCase.args) if err == nil {