Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/command/system/version.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sneaky little commit that's unrelated :)

Copy link
Member Author

@thaJeztah thaJeztah Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a .golden file, and used for the extra test-case that was added;

assert.Check(t, golden.String(cli.OutBuffer().String(), "docker-client-version.json.golden"))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂 so I thought you meant that JSON file, but it was referring to the "make it a const" commit. I had that in another PR, but doing it later would mean we had more code-churn, as the lines using it are touched by this PR, so I moved it first to prevent that.

Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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)
Expand Down