Skip to content

Commit

Permalink
Remove deprecated ioutil (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristonianJones authored Jun 6, 2024
1 parent df64c59 commit 74de262
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cel/cel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"reflect"
"strings"
"sync"
Expand Down Expand Up @@ -416,7 +416,7 @@ func TestCustomTypes(t *testing.T) {
}

func TestTypeIsolation(t *testing.T) {
b, err := ioutil.ReadFile("testdata/team.fds")
b, err := os.ReadFile("testdata/team.fds")
if err != nil {
t.Fatal("can't read fds file: ", err)
}
Expand All @@ -441,9 +441,9 @@ func TestTypeIsolation(t *testing.T) {
}

func TestDynamicProto(t *testing.T) {
b, err := ioutil.ReadFile("testdata/team.fds")
b, err := os.ReadFile("testdata/team.fds")
if err != nil {
t.Fatalf("ioutil.ReadFile() failed: %v", err)
t.Fatalf("os.ReadFile() failed: %v", err)
}
var fds descpb.FileDescriptorSet
if err = proto.Unmarshal(b, &fds); err != nil {
Expand Down Expand Up @@ -496,9 +496,9 @@ func TestDynamicProto(t *testing.T) {
}

func TestDynamicProtoFileDescriptors(t *testing.T) {
b, err := ioutil.ReadFile("testdata/team.fds")
b, err := os.ReadFile("testdata/team.fds")
if err != nil {
t.Fatalf("ioutil.ReadFile() failed: %v", err)
t.Fatalf("os.ReadFile() failed: %v", err)
}
var fds descpb.FileDescriptorSet
if err = proto.Unmarshal(b, &fds); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions repl/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package repl
import (
"errors"
"fmt"
"io/ioutil"
"os"
"strings"

"github.com/google/cel-go/cel"
Expand Down Expand Up @@ -816,7 +816,7 @@ func (e *Evaluator) loadExtensionOptionType(extType string) error {
}

func loadFileDescriptorSet(path string, textfmt bool) (*descpb.FileDescriptorSet, error) {
data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 74de262

Please sign in to comment.