Skip to content

Commit 400b9a6

Browse files
authored
Merge pull request #4197 from thaJeztah/cobra_template_const
cli: make cobra templates a const
2 parents 6416d81 + c388fe4 commit 400b9a6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cli/cobra.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func invalidPluginReason(cmd *cobra.Command) string {
426426
return cmd.Annotations[pluginmanager.CommandAnnotationPluginInvalid]
427427
}
428428

429-
var usageTemplate = `Usage:
429+
const usageTemplate = `Usage:
430430
431431
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
432432
{{- if .HasSubCommands}} {{ .CommandPath}}{{- if .HasAvailableFlags}} [OPTIONS]{{end}} COMMAND{{end}}
@@ -525,5 +525,5 @@ Run '{{.CommandPath}} COMMAND --help' for more information on a command.
525525
{{- end}}
526526
`
527527

528-
var helpTemplate = `
528+
const helpTemplate = `
529529
{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`

0 commit comments

Comments
 (0)