diff options
author | Eng Zer Jun <engzerjun@gmail.com> | 2021-09-22 13:38:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-22 13:38:34 +0800 |
commit | f2e7d5477f076789da5d0e95fe61a56ddb939f5a (patch) | |
tree | 922ca8769761c30e93f3b4deaf27858026b27ebf /modules/queue | |
parent | aa631d8cd18251aa9b18ce72f75c8d8c7090e5e7 (diff) | |
download | gitea-f2e7d5477f076789da5d0e95fe61a56ddb939f5a.tar.gz gitea-f2e7d5477f076789da5d0e95fe61a56ddb939f5a.zip |
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 <engzerjun@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/queue')
-rw-r--r-- | modules/queue/queue_disk_channel_test.go | 4 | ||||
-rw-r--r-- | modules/queue/queue_disk_test.go | 4 |
2 files changed, 4 insertions, 4 deletions
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) |