From 1f970af1f874086e7c4482b7ec92f9866c898280 Mon Sep 17 00:00:00 2001 From: Snorre lothar von Gohren Edwin Date: Sun, 20 Dec 2015 09:25:50 +0100 Subject: [PATCH] added right amount of return --- token.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token.go b/token.go index 1bca6648..e15ce82d 100644 --- a/token.go +++ b/token.go @@ -85,7 +85,7 @@ func (t *Token) SigningString() (string, error) { // If everything is kosher, err will be nil func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { if strings.Contains(strings.ToLower(tokenString), "bearer") { - return &ValidationError{err: "tokenstring should not contain bearer", Errors: ValidationErrorMalformed} + return nil, &ValidationError{err: "tokenstring should not contain bearer", Errors: ValidationErrorMalformed} } return new(Parser).Parse(tokenString, keyFunc) }