From 4127914e0d3e93080bc50d355e17b11d80bb71c8 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Fri, 20 Dec 2024 14:57:06 +0100 Subject: [PATCH] Remove the need to use the type to access the function Signed-off-by: cmoulliard --- pkg/printer/cluster.go | 4 ++-- pkg/printer/secret.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/printer/cluster.go b/pkg/printer/cluster.go index 8cdb5a8d..4ebd4c55 100644 --- a/pkg/printer/cluster.go +++ b/pkg/printer/cluster.go @@ -19,13 +19,13 @@ func (cp ClusterPrinter) PrintOutput(format string) error { case "yaml": return PrintDataAsYaml(cp.Clusters, cp.OutWriter) case "table": - return PrintDataAsTable(cp.generateClusterTable(cp.Clusters), cp.OutWriter) + return PrintDataAsTable(generateClusterTable(cp.Clusters), cp.OutWriter) default: return fmt.Errorf("output format %s is not supported", format) } } -func (cp ClusterPrinter) generateClusterTable(input []entity.Cluster) metav1.Table { +func generateClusterTable(input []entity.Cluster) metav1.Table { table := &metav1.Table{} table.ColumnDefinitions = []metav1.TableColumnDefinition{ {Name: "Name", Type: "string"}, diff --git a/pkg/printer/secret.go b/pkg/printer/secret.go index 206aa7cb..425f961d 100644 --- a/pkg/printer/secret.go +++ b/pkg/printer/secret.go @@ -20,13 +20,13 @@ func (sp SecretPrinter) PrintOutput(format string) error { case "yaml": return PrintDataAsYaml(sp.Secrets, sp.OutWriter) case "table": - return PrintDataAsTable(sp.generateSecretTable(sp.Secrets), sp.OutWriter) + return PrintDataAsTable(generateSecretTable(sp.Secrets), sp.OutWriter) default: return fmt.Errorf("output format %s is not supported", format) } } -func (sp SecretPrinter) generateSecretTable(secretTable []entity.Secret) metav1.Table { +func generateSecretTable(secretTable []entity.Secret) metav1.Table { table := &metav1.Table{} table.ColumnDefinitions = []metav1.TableColumnDefinition{ {Name: "Name", Type: "string"},