mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-10 01:00:29 +00:00
refactor: move from io/ioutil to io and os packages (#1417)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a73d5063d8
commit
2f1c5a19f1
7 files changed
+25
-30
No files matched your search
@@ -2,7 +2,7 @@ package container
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
@@ -45,7 +45,7 @@ func TestImageExistsLocally(t *testing.T) {
|
||||
})
|
||||
assert.Nil(t, err)
|
||||
defer readerDefault.Close()
|
||||
_, err = ioutil.ReadAll(readerDefault)
|
||||
_, err = io.ReadAll(readerDefault)
|
||||
assert.Nil(t, err)
|
||||
|
||||
imageDefaultArchExists, err := ImageExistsLocally(ctx, "node:16-buster-slim", "linux/amd64")
|
||||
@@ -58,7 +58,7 @@ func TestImageExistsLocally(t *testing.T) {
|
||||
})
|
||||
assert.Nil(t, err)
|
||||
defer readerArm64.Close()
|
||||
_, err = ioutil.ReadAll(readerArm64)
|
||||
_, err = io.ReadAll(readerArm64)
|
||||
assert.Nil(t, err)
|
||||
|
||||
imageArm64Exists, err := ImageExistsLocally(ctx, "node:16-buster-slim", "linux/arm64")
|
||||
|
||||
Reference in new issue
Block a user