diff options
Diffstat (limited to 'workhorse/internal/testhelper/testhelper.go')
-rw-r--r-- | workhorse/internal/testhelper/testhelper.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/workhorse/internal/testhelper/testhelper.go b/workhorse/internal/testhelper/testhelper.go index 6bbdfddcd60..6ea5c1c73e1 100644 --- a/workhorse/internal/testhelper/testhelper.go +++ b/workhorse/internal/testhelper/testhelper.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -121,7 +120,7 @@ func RootDir() string { func LoadFile(t *testing.T, filePath string) string { t.Helper() - content, err := ioutil.ReadFile(path.Join(RootDir(), filePath)) + content, err := os.ReadFile(path.Join(RootDir(), filePath)) require.NoError(t, err) return string(content) } @@ -129,7 +128,7 @@ func LoadFile(t *testing.T, filePath string) string { func ReadAll(t *testing.T, r io.Reader) []byte { t.Helper() - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) require.NoError(t, err) return b } @@ -152,7 +151,7 @@ func ParseJWT(token *jwt.Token) (interface{}, error) { // UploadClaims represents the JWT claim for upload parameters type UploadClaims struct { Upload map[string]string `json:"upload"` - jwt.StandardClaims + jwt.RegisteredClaims } func Retry(t testing.TB, timeout time.Duration, fn func() error) { @@ -176,7 +175,7 @@ func SetupStaticFileHelper(t *testing.T, fpath, content, directory string) strin require.NoError(t, os.MkdirAll(path.Join(absDocumentRoot, path.Dir(fpath)), 0755), "create document root") staticFile := path.Join(absDocumentRoot, fpath) - require.NoError(t, ioutil.WriteFile(staticFile, []byte(content), 0666), "write file content") + require.NoError(t, os.WriteFile(staticFile, []byte(content), 0666), "write file content") return absDocumentRoot } |