Skip to content

Commit 2bc4f21

Browse files
committed
auth: replace uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 941a1cd commit 2bc4f21

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

auth/auth.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"crypto/sha256"
1111
"encoding/hex"
1212
"fmt"
13-
"io/ioutil"
1413
"os"
1514
"strings"
1615
)
@@ -52,7 +51,7 @@ func New(key string, ad []byte) (*Standard, error) {
5251
case "env":
5352
key = os.Getenv(splitKey[1])
5453
case "file":
55-
data, err := ioutil.ReadFile(splitKey[1])
54+
data, err := os.ReadFile(splitKey[1])
5655
if err != nil {
5756
return nil, err
5857
}

auth/auth_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package auth
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"os"
66
"testing"
77
)
88

@@ -107,7 +107,7 @@ func TestNullRequest(t *testing.T) {
107107

108108
// Sanity check: verify a pre-generated authenticated request.
109109
func TestPreGenerated(t *testing.T) {
110-
in, err := ioutil.ReadFile("testdata/authrequest.json")
110+
in, err := os.ReadFile("testdata/authrequest.json")
111111
if err != nil {
112112
t.Fatalf("%v", err)
113113
}
@@ -126,7 +126,7 @@ func TestPreGenerated(t *testing.T) {
126126
var bmRequest []byte
127127

128128
func TestLoadBenchmarkRequest(t *testing.T) {
129-
in, err := ioutil.ReadFile("testdata/request.json")
129+
in, err := os.ReadFile("testdata/request.json")
130130
if err != nil {
131131
t.Fatalf("%v", err)
132132
}

0 commit comments

Comments
 (0)