summaryrefslogtreecommitdiff
path: root/pkg/stack
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 /pkg/stack
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 'pkg/stack')
-rw-r--r--pkg/stack/stackdump_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/stack/stackdump_test.go b/pkg/stack/stackdump_test.go
index ae58ba0a89..b40c560e7e 100644
--- a/pkg/stack/stackdump_test.go
+++ b/pkg/stack/stackdump_test.go
@@ -1,7 +1,6 @@
package stack // import "github.com/docker/docker/pkg/stack"
import (
- "io/ioutil"
"os"
"testing"
@@ -14,12 +13,12 @@ func TestDump(t *testing.T) {
}
func TestDumpToFile(t *testing.T) {
- directory, err := ioutil.TempDir("", "test-dump-tasks")
+ directory, err := os.MkdirTemp("", "test-dump-tasks")
assert.Check(t, err)
defer os.RemoveAll(directory)
dumpPath, err := DumpToFile(directory)
assert.Check(t, err)
- readFile, _ := ioutil.ReadFile(dumpPath)
+ readFile, _ := os.ReadFile(dumpPath)
fileData := string(readFile)
assert.Check(t, is.Contains(fileData, "goroutine"))
}