Skip to content

Commit 5e714a3

Browse files
authored
Update godoc example func to properly refer to NewWithClaims() (#459)
* Update example to include the New() function rather than the NewWithClaims() function * Change func name to ExampleNewWithClaims
1 parent 9d770c8 commit 5e714a3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hmac_example_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ func init() {
2424
}
2525

2626
// Example creating, signing, and encoding a JWT token using the HMAC signing method
27-
func ExampleNew_hmac() {
27+
func ExampleNewWithClaims_hmac() {
2828
// Create a new token object, specifying signing method and the claims
2929
// you would like it to contain.
3030
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
3131
"foo": "bar",
3232
"nbf": time.Date(2015, 10, 10, 12, 0, 0, 0, time.UTC).Unix(),
3333
})
34-
3534
// Sign and get the complete encoded token as a string using the secret
3635
tokenString, err := token.SignedString(hmacSampleSecret)
3736

0 commit comments

Comments
 (0)