all: replace non-trivial uses of package ioutil with os (#24886)

Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
Håvard Anda Estensen
2022-05-17 14:27:04 +02:00
committed by GitHub
co-authored by Martin Holst Swende
parent e644d45c14
commit 4b309c7006
9 changed files with 19 additions and 24 deletions
+1 -2
View File
@@ -17,7 +17,6 @@
package main
import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -163,7 +162,7 @@ Password: {{.InputLine "foo"}}
Address: {d4584b5f6229b7be90727b0fc8c6b91bb427821f}
`)
files, err := ioutil.ReadDir(filepath.Join(geth.Datadir, "keystore"))
files, err := os.ReadDir(filepath.Join(geth.Datadir, "keystore"))
if len(files) != 1 {
t.Errorf("expected one key file in keystore directory, found %d files (error: %v)", len(files), err)
}
+1 -2
View File
@@ -19,7 +19,6 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
@@ -55,7 +54,7 @@ func testVerification(t *testing.T, pubkey, sigdir string) {
t.Fatal(err)
}
// Signatures, with and without comments, both trusted and untrusted
files, err := ioutil.ReadDir(sigdir)
files, err := os.ReadDir(sigdir)
if err != nil {
t.Fatal(err)
}