Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
stop using the deprecated io/ioutil package (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Aug 17, 2022
1 parent 35ab42c commit 1185a08
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crypto/fixture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"os"
"testing"

"github.com/libp2p/go-libp2p-core/crypto"
Expand Down Expand Up @@ -46,15 +46,15 @@ func fname(kt crypto_pb.KeyType, ext string) string {
func TestFixtures(t *testing.T) {
for _, tc := range keyTypes {
t.Run(tc.keyType.String(), func(t *testing.T) {
pubBytes, err := ioutil.ReadFile(fname(tc.keyType, "pub"))
pubBytes, err := os.ReadFile(fname(tc.keyType, "pub"))
if err != nil {
t.Fatal(err)
}
privBytes, err := ioutil.ReadFile(fname(tc.keyType, "priv"))
privBytes, err := os.ReadFile(fname(tc.keyType, "priv"))
if err != nil {
t.Fatal(err)
}
sigBytes, err := ioutil.ReadFile(fname(tc.keyType, "sig"))
sigBytes, err := os.ReadFile(fname(tc.keyType, "sig"))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -125,8 +125,8 @@ func generate() {
if err != nil {
panic(err)
}
ioutil.WriteFile(fname(tc.keyType, "pub"), pubb, 0666)
ioutil.WriteFile(fname(tc.keyType, "priv"), privb, 0666)
ioutil.WriteFile(fname(tc.keyType, "sig"), sig, 0666)
os.WriteFile(fname(tc.keyType, "pub"), pubb, 0666)
os.WriteFile(fname(tc.keyType, "priv"), privb, 0666)
os.WriteFile(fname(tc.keyType, "sig"), sig, 0666)
}
}

0 comments on commit 1185a08

Please sign in to comment.