Skip to content

Commit

Permalink
Replaced all instances of ioutil in checksum_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswolfdesign committed Aug 11, 2022
1 parent 59d1032 commit d9d6d1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions checksum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package keyfunc_test

import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
Expand All @@ -17,7 +16,7 @@ import (

// TestChecksum confirms that the JWKS will only perform a refresh if a new JWKS is read from the remote resource.
func TestChecksum(t *testing.T) {
tempDir, err := ioutil.TempDir("", "*")
tempDir, err := os.MkdirTemp("", "*")
if err != nil {
t.Fatalf(logFmt, "Failed to create a temporary directory.", err)
}
Expand All @@ -30,7 +29,7 @@ func TestChecksum(t *testing.T) {

jwksFile := filepath.Join(tempDir, jwksFilePath)

err = ioutil.WriteFile(jwksFile, []byte(jwksJSON), 0600)
err = os.WriteFile(jwksFile, []byte(jwksJSON), 0600)
if err != nil {
t.Fatalf(logFmt, "Failed to write JWKS file to temporary directory.", err)
}
Expand Down Expand Up @@ -86,7 +85,7 @@ func TestChecksum(t *testing.T) {
if err != nil {
t.Fatalf(logFmt, "Failed to create a test JWKS.", err)
}
err = ioutil.WriteFile(jwksFile, jwksBytes, 0600)
err = os.WriteFile(jwksFile, jwksBytes, 0600)
if err != nil {
t.Fatalf(logFmt, "Failed to write JWKS file to temporary directory.", err)
}
Expand Down

0 comments on commit d9d6d1d

Please sign in to comment.