mirror of https://github.com/golang-jwt/jwt.git
Merge branch 'dg/example_code' into release_3_0_0
This commit is contained in:
commit
1b765952cc
|
@ -54,8 +54,8 @@ func ExampleParse_hmac() {
|
||||||
return hmacSampleSecret, nil
|
return hmacSampleSecret, nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if claims, ok := token.Claims.(*jwt.MapClaims); ok && token.Valid {
|
if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid {
|
||||||
fmt.Println((*claims)["foo"], (*claims)["nbf"])
|
fmt.Println(claims["foo"], claims["nbf"])
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue