Skip to content

Commit 4698401

Browse files
committed
change fmt.Errorf to errors.New
1 parent 7d34472 commit 4698401

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

webauthn.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package mfa
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67
"io"
78
"log"
@@ -234,19 +235,19 @@ func getWebauthnMetaFromRequest(r *http.Request) (WebauthnMeta, error) {
234235
// check that required fields are provided
235236
if meta.RPDisplayName == "" {
236237
msg := "missing required header: x-mfa-RPDisplayName"
237-
return WebauthnMeta{}, fmt.Errorf(msg)
238+
return WebauthnMeta{}, errors.New(msg)
238239
}
239240
if meta.RPID == "" {
240241
msg := "missing required header: x-mfa-RPID"
241-
return WebauthnMeta{}, fmt.Errorf(msg)
242+
return WebauthnMeta{}, errors.New(msg)
242243
}
243244
if meta.Username == "" {
244245
msg := "missing required header: x-mfa-Username"
245-
return WebauthnMeta{}, fmt.Errorf(msg)
246+
return WebauthnMeta{}, errors.New(msg)
246247
}
247248
if meta.UserDisplayName == "" {
248249
msg := "missing required header: x-mfa-UserDisplayName"
249-
return WebauthnMeta{}, fmt.Errorf(msg)
250+
return WebauthnMeta{}, errors.New(msg)
250251
}
251252

252253
return meta, nil

0 commit comments

Comments
 (0)