Skip to content

Commit 80640bc

Browse files
committed
cli/command/system: make default version template a const
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 46234b8 commit 80640bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cli/command/system/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/tonistiigi/go-rosetta"
2121
)
2222

23-
var versionTemplate = `{{with .Client -}}
23+
const defaultVersionTemplate = `{{with .Client -}}
2424
Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
2525
Version: {{.Version}}
2626
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
195195

196196
func newVersionTemplate(templateFormat string) (*template.Template, error) {
197197
if templateFormat == "" {
198-
templateFormat = versionTemplate
198+
templateFormat = defaultVersionTemplate
199199
}
200200
tmpl := templates.New("version").Funcs(template.FuncMap{"getDetailsOrder": getDetailsOrder})
201201
tmpl, err := tmpl.Parse(templateFormat)

0 commit comments

Comments
 (0)