Skip to content

Commit

Permalink
Remove the need to use the type to access the function
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Dec 20, 2024
1 parent 3a2c119 commit 4127914
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/printer/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
4 changes: 2 additions & 2 deletions pkg/printer/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 4127914

Please sign in to comment.