diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index f9fa17823a4..52d171419d7 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -36,7 +36,6 @@ vendor/k8s.io/apiserver/pkg/storage/tests vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope vendor/k8s.io/apiserver/pkg/util/webhook vendor/k8s.io/apiserver/pkg/util/wsstream -vendor/k8s.io/cli-runtime/pkg/printers vendor/k8s.io/client-go/discovery vendor/k8s.io/client-go/rest vendor/k8s.io/client-go/rest/watch diff --git a/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go b/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go index 56bd05aa0d3..048cb66a2ba 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go +++ b/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go @@ -94,9 +94,8 @@ func printHeader(columnNames []string, w io.Writer) error { // PrintObj prints the obj in a human-friendly format according to the type of the obj. func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) error { - w, found := output.(*tabwriter.Writer) - if !found { - w = GetNewTabWriter(output) + if _, found := output.(*tabwriter.Writer); !found { + w := GetNewTabWriter(output) output = w defer w.Flush() }