From f2e7d5477f076789da5d0e95fe61a56ddb939f5a Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Wed, 22 Sep 2021 13:38:34 +0800 Subject: refactor: move from io/ioutil to io and os package (#17109) The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun Co-authored-by: techknowlogick --- modules/queue/queue_disk_channel_test.go | 4 ++-- modules/queue/queue_disk_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/queue') diff --git a/modules/queue/queue_disk_channel_test.go b/modules/queue/queue_disk_channel_test.go index 06cb7a7a96..99fb65934e 100644 --- a/modules/queue/queue_disk_channel_test.go +++ b/modules/queue/queue_disk_channel_test.go @@ -5,7 +5,7 @@ package queue import ( - "io/ioutil" + "os" "sync" "testing" @@ -26,7 +26,7 @@ func TestPersistableChannelQueue(t *testing.T) { queueShutdown := []func(){} queueTerminate := []func(){} - tmpDir, err := ioutil.TempDir("", "persistable-channel-queue-test-data") + tmpDir, err := os.MkdirTemp("", "persistable-channel-queue-test-data") assert.NoError(t, err) defer util.RemoveAll(tmpDir) diff --git a/modules/queue/queue_disk_test.go b/modules/queue/queue_disk_test.go index 1f884d4f8d..549a04104e 100644 --- a/modules/queue/queue_disk_test.go +++ b/modules/queue/queue_disk_test.go @@ -5,7 +5,7 @@ package queue import ( - "io/ioutil" + "os" "sync" "testing" "time" @@ -28,7 +28,7 @@ func TestLevelQueue(t *testing.T) { queueShutdown := []func(){} queueTerminate := []func(){} - tmpDir, err := ioutil.TempDir("", "level-queue-test-data") + tmpDir, err := os.MkdirTemp("", "level-queue-test-data") assert.NoError(t, err) defer util.RemoveAll(tmpDir) -- cgit v1.2.3