mirror of https://github.com/docker/cli.git
cli/command/system: make default version template a const
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 80640bca72
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2c1fde2239
commit
9dfe5a29ee
|
@ -20,7 +20,7 @@ import (
|
|||
"github.com/tonistiigi/go-rosetta"
|
||||
)
|
||||
|
||||
var versionTemplate = `{{with .Client -}}
|
||||
const defaultVersionTemplate = `{{with .Client -}}
|
||||
Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
|
||||
Version: {{.Version}}
|
||||
API version: {{.APIVersion}}{{if ne .APIVersion .DefaultAPIVersion}} (downgraded from {{.DefaultAPIVersion}}){{end}}
|
||||
|
@ -195,7 +195,7 @@ func prettyPrintVersion(dockerCli command.Cli, vd versionInfo, tmpl *template.Te
|
|||
|
||||
func newVersionTemplate(templateFormat string) (*template.Template, error) {
|
||||
if templateFormat == "" {
|
||||
templateFormat = versionTemplate
|
||||
templateFormat = defaultVersionTemplate
|
||||
}
|
||||
tmpl := templates.New("version").Funcs(template.FuncMap{"getDetailsOrder": getDetailsOrder})
|
||||
tmpl, err := tmpl.Parse(templateFormat)
|
||||
|
|
Loading…
Reference in New Issue