Skip to content

Commit 278e758

Browse files
author
Aditi Rajagopal
committed
pkg/version.Version: use the new String() method
Resolves moby#18750 Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
1 parent 92605b8 commit 278e758

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/client/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, clientFlags *cli.ClientF
104104
}
105105
customHeaders["User-Agent"] = "Docker-Client/" + dockerversion.Version + " (" + runtime.GOOS + ")"
106106

107-
verStr := string(api.DefaultVersion)
107+
verStr := api.DefaultVersion.String()
108108
if tmpStr := os.Getenv("DOCKER_API_VERSION"); tmpStr != "" {
109109
verStr = tmpStr
110110
}

integration-cli/docker_api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (s *DockerSuite) TestApiVersionStatusCode(c *check.C) {
4949
}
5050

5151
func (s *DockerSuite) TestApiClientVersionNewerThanServer(c *check.C) {
52-
v := strings.Split(string(api.DefaultVersion), ".")
52+
v := strings.Split(api.DefaultVersion.String(), ".")
5353
vMinInt, err := strconv.Atoi(v[1])
5454
c.Assert(err, checker.IsNil)
5555
vMinInt++
@@ -63,7 +63,7 @@ func (s *DockerSuite) TestApiClientVersionNewerThanServer(c *check.C) {
6363
}
6464

6565
func (s *DockerSuite) TestApiClientVersionOldNotSupported(c *check.C) {
66-
v := strings.Split(string(api.MinVersion), ".")
66+
v := strings.Split(api.MinVersion.String(), ".")
6767
vMinInt, err := strconv.Atoi(v[1])
6868
c.Assert(err, checker.IsNil)
6969
vMinInt--

0 commit comments

Comments
 (0)