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 /daemon/daemon_unix_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 'daemon/daemon_unix_test.go')
-rw-r--r-- | daemon/daemon_unix_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/daemon/daemon_unix_test.go b/daemon/daemon_unix_test.go index cdad58596e..65244ad576 100644 --- a/daemon/daemon_unix_test.go +++ b/daemon/daemon_unix_test.go @@ -5,7 +5,6 @@ package daemon // import "github.com/docker/docker/daemon" import ( "errors" - "io/ioutil" "os" "path/filepath" "testing" @@ -60,7 +59,7 @@ func TestAdjustSharedNamespaceContainerName(t *testing.T) { // Unix test as uses settings which are not available on Windows func TestAdjustCPUShares(t *testing.T) { - tmp, err := ioutil.TempDir("", "docker-daemon-unix-test-") + tmp, err := os.MkdirTemp("", "docker-daemon-unix-test-") if err != nil { t.Fatal(err) } @@ -100,7 +99,7 @@ func TestAdjustCPUShares(t *testing.T) { // Unix test as uses settings which are not available on Windows func TestAdjustCPUSharesNoAdjustment(t *testing.T) { - tmp, err := ioutil.TempDir("", "docker-daemon-unix-test-") + tmp, err := os.MkdirTemp("", "docker-daemon-unix-test-") if err != nil { t.Fatal(err) } @@ -397,7 +396,7 @@ func deviceTypeMock(t *testing.T, testAndCheck func(string)) { t.Parallel() - tempDir, err := ioutil.TempDir("", "tempDevDir"+t.Name()) + tempDir, err := os.MkdirTemp("", "tempDevDir"+t.Name()) assert.NilError(t, err, "create temp file") tempFile := filepath.Join(tempDir, "dev") |