Skip to content

Commit c9e94ad

Browse files
authored
Avoid deprecated use of io/ioutil package (#291)
1 parent c78331f commit c9e94ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

testdata_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package json
77
import (
88
"bytes"
99
"compress/gzip"
10-
"io/ioutil"
10+
"io"
1111
"os"
1212
"path/filepath"
1313
"sort"
@@ -30,7 +30,7 @@ var (
3030

3131
func jsonTestdata() []jsonTestdataEntry {
3232
jsonTestdataOnce.Do(func() {
33-
fis, err := ioutil.ReadDir("testdata")
33+
fis, err := os.ReadDir("testdata")
3434
if err != nil {
3535
panic(err)
3636
}
@@ -56,15 +56,15 @@ func jsonTestdata() []jsonTestdataEntry {
5656
name := strings.Join(words, "")
5757

5858
// Read and decompress the test data.
59-
b, err := ioutil.ReadFile(filepath.Join("testdata", fi.Name()))
59+
b, err := os.ReadFile(filepath.Join("testdata", fi.Name()))
6060
if err != nil {
6161
panic(err)
6262
}
6363
zr, err := gzip.NewReader(bytes.NewReader(b))
6464
if err != nil {
6565
panic(err)
6666
}
67-
data, err := ioutil.ReadAll(zr)
67+
data, err := io.ReadAll(zr)
6868
if err != nil {
6969
panic(err)
7070
}

0 commit comments

Comments
 (0)