From 0369093976532318bfa1469432942be564f6b39b Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Thu, 12 Sep 2024 14:13:00 +0300 Subject: [PATCH] refactor: move err declaration to the top of a file --- internal/jwtutil/jwtutil.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/jwtutil/jwtutil.go b/internal/jwtutil/jwtutil.go index 1a323f2..aa7f652 100644 --- a/internal/jwtutil/jwtutil.go +++ b/internal/jwtutil/jwtutil.go @@ -9,6 +9,8 @@ import ( "github.com/golang-jwt/jwt/v5" ) +var ErrUnexpectedSigningMethod = errors.New("unexpected signing method") + type JWTTokenizer interface { // AccessToken generates a new access token with the given payload AccessToken(pl Payload) (string, error) @@ -54,8 +56,6 @@ func (j *JWTUtil) RefreshToken() (string, error) { return hex.EncodeToString(b), nil } -var ErrUnexpectedSigningMethod = errors.New("unexpected signing method") - func (j *JWTUtil) Parse(token string) (Payload, error) { var claims jwt.RegisteredClaims _, err := jwt.ParseWithClaims(token, &claims, func(t *jwt.Token) (interface{}, error) {