Skip to content

Commit

Permalink
Use 'os' instead of 'ioutil' in gazelle tests (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
aignas committed Jan 2, 2023
1 parent 4dde147 commit 9022291
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions gazelle/manifest/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package manifest_test

import (
"bytes"
"io/ioutil"
"log"
"os"
"reflect"
Expand Down Expand Up @@ -44,7 +43,7 @@ func TestFile(t *testing.T) {
log.Println(err)
t.FailNow()
}
expected, err := ioutil.ReadFile("testdata/gazelle_python.yaml")
expected, err := os.ReadFile("testdata/gazelle_python.yaml")
if err != nil {
log.Println(err)
t.FailNow()
Expand Down
5 changes: 2 additions & 3 deletions gazelle/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -94,9 +93,9 @@ func testPath(t *testing.T, name string, files []bazel.RunfileEntry) {
continue
}

content, err := ioutil.ReadFile(path)
content, err := os.ReadFile(path)
if err != nil {
t.Errorf("ioutil.ReadFile(%q) error: %v", path, err)
t.Errorf("os.ReadFile(%q) error: %v", path, err)
}

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

0 comments on commit 9022291

Please sign in to comment.