mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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>
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
package daemon // import "github.com/docker/docker/daemon"
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -186,7 +185,7 @@ func TestRootMountCleanup(t *testing.T) {
|
||||
|
||||
t.Parallel()
|
||||
|
||||
testRoot, err := ioutil.TempDir("", t.Name())
|
||||
testRoot, err := os.MkdirTemp("", t.Name())
|
||||
assert.NilError(t, err)
|
||||
defer os.RemoveAll(testRoot)
|
||||
cfg := &config.Config{}
|
||||
@@ -258,7 +257,7 @@ func TestRootMountCleanup(t *testing.T) {
|
||||
err = mount.MakeShared(testRoot)
|
||||
assert.NilError(t, err)
|
||||
defer mount.MakePrivate(testRoot)
|
||||
err = ioutil.WriteFile(unmountFile, nil, 0644)
|
||||
err = os.WriteFile(unmountFile, nil, 0644)
|
||||
assert.NilError(t, err)
|
||||
|
||||
err = setupDaemonRootPropagation(cfg)
|
||||
|
||||
Reference in New Issue
Block a user