Skip to content

Commit c388fe4

Browse files
committed
cli: make cobra templates a const
Saves me from having to look if they're possibly updated/overwritten anywhere in the code. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent b799ab9 commit c388fe4

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)