diff options
author | Eng Zer Jun <engzerjun@gmail.com> | 2021-08-24 18:10:50 +0800 |
---|---|---|
committer | Eng Zer Jun <engzerjun@gmail.com> | 2021-08-27 14:56:57 +0800 |
commit | c55a4ac7795c7606b548b38e24673733481e2167 (patch) | |
tree | 8ea03bdc842959cd3d04a3e37a4ce2a71fa77dbb /integration-cli/fixtures_linux_daemon_test.go | |
parent | 2b70006e3bfa492b8641ff443493983d832955f4 (diff) | |
download | docker-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/fixtures_linux_daemon_test.go')
-rw-r--r-- | integration-cli/fixtures_linux_daemon_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/integration-cli/fixtures_linux_daemon_test.go b/integration-cli/fixtures_linux_daemon_test.go index aa301cb001..b91b510c1f 100644 --- a/integration-cli/fixtures_linux_daemon_test.go +++ b/integration-cli/fixtures_linux_daemon_test.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -29,7 +28,7 @@ func ensureSyscallTest(c *testing.T) { return } - tmp, err := ioutil.TempDir("", "syscall-test-build") + tmp, err := os.MkdirTemp("", "syscall-test-build") assert.NilError(c, err, "couldn't create temp dir") defer os.RemoveAll(tmp) @@ -52,7 +51,7 @@ func ensureSyscallTest(c *testing.T) { FROM debian:bullseye-slim COPY . /usr/bin/ `) - err = ioutil.WriteFile(dockerFile, content, 0600) + err = os.WriteFile(dockerFile, content, 0600) assert.NilError(c, err) var buildArgs []string @@ -92,7 +91,7 @@ func ensureNNPTest(c *testing.T) { return } - tmp, err := ioutil.TempDir("", "docker-nnp-test") + tmp, err := os.MkdirTemp("", "docker-nnp-test") assert.NilError(c, err) gcc, err := exec.LookPath("gcc") @@ -107,7 +106,7 @@ func ensureNNPTest(c *testing.T) { COPY . /usr/bin RUN chmod +s /usr/bin/nnp-test ` - err = ioutil.WriteFile(dockerfile, []byte(content), 0600) + err = os.WriteFile(dockerfile, []byte(content), 0600) assert.NilError(c, err, "could not write Dockerfile for nnp-test image") var buildArgs []string |