Skip to content

Commit

Permalink
Update parser.go
Browse files Browse the repository at this point in the history
pkg/jwt/parser.go:105:5: S1009: should omit nil check; len() for []encoding/json.RawMessage is defined as zero (gosimple)
空判断去除
  • Loading branch information
admininfon authored Nov 20, 2024
1 parent ce89521 commit 4526fe2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/jwt/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Toke
token = &Token{Raw: tokenString}

// verify slice to make sure it's valid
if token.TokenSegmentRows == nil || len(token.TokenSegmentRows) == 0 {
if len(token.TokenSegmentRows) == 0 {
token.TokenSegmentRows = make([]json.RawMessage, 0, len(parts))
}

Expand Down

0 comments on commit 4526fe2

Please sign in to comment.