Skip to content

Commit 9022291

Browse files
authored
Use 'os' instead of 'ioutil' in gazelle tests (#962)
1 parent 4dde147 commit 9022291

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

gazelle/manifest/manifest_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package manifest_test
22

33
import (
44
"bytes"
5-
"io/ioutil"
65
"log"
76
"os"
87
"reflect"
@@ -44,7 +43,7 @@ func TestFile(t *testing.T) {
4443
log.Println(err)
4544
t.FailNow()
4645
}
47-
expected, err := ioutil.ReadFile("testdata/gazelle_python.yaml")
46+
expected, err := os.ReadFile("testdata/gazelle_python.yaml")
4847
if err != nil {
4948
log.Println(err)
5049
t.FailNow()

gazelle/python_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"context"
2525
"errors"
2626
"fmt"
27-
"io/ioutil"
2827
"os"
2928
"os/exec"
3029
"path/filepath"
@@ -94,9 +93,9 @@ func testPath(t *testing.T, name string, files []bazel.RunfileEntry) {
9493
continue
9594
}
9695

97-
content, err := ioutil.ReadFile(path)
96+
content, err := os.ReadFile(path)
9897
if err != nil {
99-
t.Errorf("ioutil.ReadFile(%q) error: %v", path, err)
98+
t.Errorf("os.ReadFile(%q) error: %v", path, err)
10099
}
101100

102101
if filepath.Base(shortPath) == "test.yaml" {

0 commit comments

Comments
 (0)