diff --git a/hmac_example_test.go b/hmac_example_test.go index dafdd673..179d9c1d 100644 --- a/hmac_example_test.go +++ b/hmac_example_test.go @@ -24,14 +24,13 @@ func init() { } // Example creating, signing, and encoding a JWT token using the HMAC signing method -func ExampleNew_hmac() { +func ExampleNewWithClaims_hmac() { // Create a new token object, specifying signing method and the claims // you would like it to contain. token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ "foo": "bar", "nbf": time.Date(2015, 10, 10, 12, 0, 0, 0, time.UTC).Unix(), }) - // Sign and get the complete encoded token as a string using the secret tokenString, err := token.SignedString(hmacSampleSecret)