Skip to content

Commit 0c4e387

Browse files
authored
Add doc comment to ParseWithClaims (#232)
1 parent bfea432 commit 0c4e387

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

parser.go

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
4242
return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
4343
}
4444

45+
// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default
46+
// object implementing the Claims interface. This provides default values which
47+
// can be overridden and allows a caller to use their own type, rather than
48+
// the default MapClaims implementation of Claims.
4549
func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
4650
token, parts, err := p.ParseUnverified(tokenString, claims)
4751
if err != nil {

0 commit comments

Comments
 (0)