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>
This commit is contained in:
parent
46234b82e2
commit
80640bca72
|
@ -20,7 +20,7 @@ import (
|
||||||
"github.com/tonistiigi/go-rosetta"
|
"github.com/tonistiigi/go-rosetta"
|
||||||
)
|
)
|
||||||
|
|
||||||
var versionTemplate = `{{with .Client -}}
|
const defaultVersionTemplate = `{{with .Client -}}
|
||||||
Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
|
Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
|
||||||
Version: {{.Version}}
|
Version: {{.Version}}
|
||||||
API version: {{.APIVersion}}{{if ne .APIVersion .DefaultAPIVersion}} (downgraded from {{.DefaultAPIVersion}}){{end}}
|
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) {
|
func newVersionTemplate(templateFormat string) (*template.Template, error) {
|
||||||
if templateFormat == "" {
|
if templateFormat == "" {
|
||||||
templateFormat = versionTemplate
|
templateFormat = defaultVersionTemplate
|
||||||
}
|
}
|
||||||
tmpl := templates.New("version").Funcs(template.FuncMap{"getDetailsOrder": getDetailsOrder})
|
tmpl := templates.New("version").Funcs(template.FuncMap{"getDetailsOrder": getDetailsOrder})
|
||||||
tmpl, err := tmpl.Parse(templateFormat)
|
tmpl, err := tmpl.Parse(templateFormat)
|
||||||
|
|
Loading…
Reference in New Issue