@@ -16,6 +16,7 @@ import (
1616 flagsHelper "github.com/docker/cli/cli/flags"
1717 "github.com/docker/cli/cli/version"
1818 "github.com/docker/cli/templates"
19+ "github.com/docker/docker/api"
1920 "github.com/docker/docker/api/types"
2021 "github.com/pkg/errors"
2122 "github.com/spf13/cobra"
@@ -89,20 +90,20 @@ type clientVersion struct {
8990// information.
9091func newClientVersion (contextName string , dockerCli command.Cli ) clientVersion {
9192 v := clientVersion {
92- Version : version .Version ,
93- GoVersion : runtime .Version (),
94- GitCommit : version .GitCommit ,
95- BuildTime : reformatDate (version .BuildTime ),
96- Os : runtime .GOOS ,
97- Arch : arch (),
98- Context : contextName ,
93+ Version : version .Version ,
94+ DefaultAPIVersion : api .DefaultVersion ,
95+ GoVersion : runtime .Version (),
96+ GitCommit : version .GitCommit ,
97+ BuildTime : reformatDate (version .BuildTime ),
98+ Os : runtime .GOOS ,
99+ Arch : arch (),
100+ Context : contextName ,
99101 }
100102 if version .PlatformName != "" {
101103 v .Platform = & platformInfo {Name : version .PlatformName }
102104 }
103105 if dockerCli != nil {
104106 v .APIVersion = dockerCli .CurrentVersion ()
105- v .DefaultAPIVersion = dockerCli .DefaultVersion ()
106107 }
107108 return v
108109}
@@ -196,8 +197,8 @@ func runVersion(ctx context.Context, dockerCli command.Cli, opts *versionOptions
196197func prettyPrintVersion (dockerCli command.Cli , vd versionInfo , tmpl * template.Template ) error {
197198 t := tabwriter .NewWriter (dockerCli .Out (), 20 , 1 , 1 , ' ' , 0 )
198199 err := tmpl .Execute (t , vd )
199- t .Write ([]byte ("\n " ))
200- t .Flush ()
200+ _ , _ = t .Write ([]byte ("\n " ))
201+ _ = t .Flush ()
201202 return err
202203}
203204
0 commit comments