Skip to content

Commit

Permalink
⚡ Lower num allocations during flag completion
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 13, 2022
1 parent 566be4c commit 1e8b7f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/config/flags/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Namespace(cmd *cobra.Command) {
if err != nil {
return nil, cobra.ShellCompDirectiveNoFileComp
}
var names []string
names := make([]string, 0, len(namespaces.Items))
for _, namespace := range namespaces.Items {
names = append(names, namespace.Name)
}
Expand All @@ -54,7 +54,7 @@ func Pod(cmd *cobra.Command) {
if err != nil {
return nil, cobra.ShellCompDirectiveNoFileComp
}
var names []string
names := make([]string, 0, len(pods.Items))
for _, pod := range pods.Items {
names = append(names, pod.Name)
}
Expand Down

0 comments on commit 1e8b7f6

Please sign in to comment.