Replaced deprecated io/ioutil functions (#768)

Signed-off-by: slab713 <109306207+slab713@users.noreply.github.com>
This commit is contained in:
slab713
2022-09-02 14:56:02 +02:00
committed by GitHub
parent 6ae793eb51
commit 8ffb053cec
36 changed files with 249 additions and 280 deletions
+4 -4
View File
@@ -8,7 +8,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/url"
"os"
"os/exec"
@@ -157,7 +157,7 @@ func signUsingCosign(port string) error {
defer func() { _ = os.Chdir(cwd) }()
tdir, err := ioutil.TempDir("", "cosign")
tdir, err := os.MkdirTemp("", "cosign")
if err != nil {
return err
}
@@ -194,7 +194,7 @@ func signUsingNotary(port string) error {
defer func() { _ = os.Chdir(cwd) }()
tdir, err := ioutil.TempDir("", "notation")
tdir, err := os.MkdirTemp("", "notation")
if err != nil {
return err
}
@@ -653,7 +653,7 @@ func TestExpandedRepoInfo(t *testing.T) {
indexPath := path.Join(tempDir, repo1, "index.json")
indexFile, err := os.Open(indexPath)
So(err, ShouldBeNil)
buf, err := ioutil.ReadAll(indexFile)
buf, err := io.ReadAll(indexFile)
So(err, ShouldBeNil)
var index ispec.Index