summaryrefslogtreecommitdiff
path: root/libnetwork/endpoint_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 /libnetwork/endpoint_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 'libnetwork/endpoint_test.go')
-rw-r--r--libnetwork/endpoint_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/libnetwork/endpoint_test.go b/libnetwork/endpoint_test.go
index f09c5d0157..22cb160b9b 100644
--- a/libnetwork/endpoint_test.go
+++ b/libnetwork/endpoint_test.go
@@ -4,7 +4,6 @@
package libnetwork
import (
- "io/ioutil"
"os"
"testing"
@@ -36,7 +35,7 @@ fe90::2 somehost.example.com somehost
c, nws := getTestEnv(t, opts)
ctrlr := c.(*controller)
- hostsFile, err := ioutil.TempFile("", "")
+ hostsFile, err := os.CreateTemp("", "")
if err != nil {
t.Fatal(err)
}
@@ -56,7 +55,7 @@ fe90::2 somehost.example.com somehost
t.Fatal(err)
}
- data, err := ioutil.ReadFile(hostsFile.Name())
+ data, err := os.ReadFile(hostsFile.Name())
if err != nil {
t.Fatal(err)
}