summaryrefslogtreecommitdiff
path: root/integration-cli/docker_api_build_test.go
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2021-08-24 18:10:50 +0800
committerEng Zer Jun <engzerjun@gmail.com>2021-08-27 14:56:57 +0800
commitc55a4ac7795c7606b548b38e24673733481e2167 (patch)
tree8ea03bdc842959cd3d04a3e37a4ce2a71fa77dbb /integration-cli/docker_api_build_test.go
parent2b70006e3bfa492b8641ff443493983d832955f4 (diff)
downloaddocker-c55a4ac7795c7606b548b38e24673733481e2167.tar.gz
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated in Go 1.16. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Diffstat (limited to 'integration-cli/docker_api_build_test.go')
-rw-r--r--integration-cli/docker_api_build_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go
index e23de015ad..507ebe624c 100644
--- a/integration-cli/docker_api_build_test.go
+++ b/integration-cli/docker_api_build_test.go
@@ -7,7 +7,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"net/http"
"regexp"
"strings"
@@ -226,7 +225,7 @@ func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *testing.T) {
assert.NilError(c, tw.Close(), "failed to close tar archive")
- res, body, err := request.Post("/build", request.RawContent(ioutil.NopCloser(buffer)), request.ContentType("application/x-tar"))
+ res, body, err := request.Post("/build", request.RawContent(io.NopCloser(buffer)), request.ContentType("application/x-tar"))
assert.NilError(c, err)
assert.Equal(c, res.StatusCode, http.StatusOK)
@@ -326,7 +325,7 @@ func (s *DockerRegistrySuite) TestBuildCopyFromForcePull(c *testing.T) {
// push the image to the registry
rc, err := client.ImagePush(context.TODO(), repoName, types.ImagePushOptions{RegistryAuth: "{}"})
assert.Check(c, err)
- _, err = io.Copy(ioutil.Discard, rc)
+ _, err = io.Copy(io.Discard, rc)
assert.Check(c, err)
dockerfile := fmt.Sprintf(`