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:
@@ -1,7 +1,6 @@
|
||||
package daemon // import "github.com/docker/docker/daemon"
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -147,7 +146,7 @@ func TestContainerInitDNS(t *testing.T) {
|
||||
t.Skip("root required") // for chown
|
||||
}
|
||||
|
||||
tmp, err := ioutil.TempDir("", "docker-container-test-")
|
||||
tmp, err := os.MkdirTemp("", "docker-container-test-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -181,7 +180,7 @@ func TestContainerInitDNS(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = ioutil.WriteFile(configPath, []byte(config), 0644); err != nil {
|
||||
if err = os.WriteFile(configPath, []byte(config), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -194,7 +193,7 @@ func TestContainerInitDNS(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = ioutil.WriteFile(hostConfigPath, []byte(hostConfig), 0644); err != nil {
|
||||
if err = os.WriteFile(hostConfigPath, []byte(hostConfig), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user