@@ -81,7 +81,7 @@ import (
8181 " github.com/lestrrat-go/jwx/v3/jwt"
8282)
8383
84- func ExampleJWT_Parse () {
84+ func Example_jwt_parse () {
8585 tok , err := jwt.Parse (jwtSignedWithHS256, jwt.WithKey (jwa.HS256 (), jwkSymmetricKey))
8686 if err != nil {
8787 fmt.Printf (" %s \n " , err)
@@ -112,7 +112,7 @@ import (
112112 " github.com/lestrrat-go/jwx/v3/jwt"
113113)
114114
115- func ExampleJWT_ReadFile () {
115+ func Example_jwt_readfile () {
116116 f , err := os.CreateTemp (` ` , ` jwt_readfile-*.jws` )
117117 if err != nil {
118118 fmt.Printf (" failed to create temporary file: %s \n " , err)
@@ -154,7 +154,7 @@ import (
154154 " github.com/lestrrat-go/jwx/v3/jwt"
155155)
156156
157- func ExampleJWT_ParseRequest_Authorization () {
157+ func Example_jwt_parse_request_authorization () {
158158 req , err := http.NewRequest (http.MethodGet , ` https://github.com/lestrrat-go/jwx` , nil )
159159 if err != nil {
160160 fmt.Printf (" failed to create request: %s \n " , err)
@@ -239,7 +239,7 @@ import (
239239 " github.com/lestrrat-go/jwx/v3/jwt"
240240)
241241
242- func ExampleJWT_Construct () {
242+ func Example_jwt_construct () {
243243 tok := jwt.New ()
244244 if err := tok.Set (jwt.IssuerKey , ` github.com/lestrrat-go/jwx` ); err != nil {
245245 fmt.Printf (" failed to set claim: %s \n " , err)
@@ -284,7 +284,7 @@ import (
284284 " github.com/lestrrat-go/jwx/v3/jwt"
285285)
286286
287- func ExampleJWT_Builder () {
287+ func Example_jwt_builder () {
288288 tok , err := jwt.NewBuilder ().
289289 Claim (` claim1` , ` value1` ).
290290 Claim (` claim2` , ` value2` ).
@@ -324,7 +324,7 @@ import (
324324 " github.com/lestrrat-go/jwx/v3/jwt"
325325)
326326
327- func ExampleJWT_ParseWithKey () {
327+ func Example_jwt_parse_with_key () {
328328 const keysrc = ` {"kty":"oct","k":"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow"}`
329329
330330 key , err := jwk.ParseKey ([]byte (keysrc))
@@ -369,7 +369,7 @@ import (
369369 " github.com/lestrrat-go/jwx/v3/jwt"
370370)
371371
372- func ExampleJWT_ParseWithKeySet () {
372+ func Example_jwt_parse_with_key_set () {
373373 var serialized []byte
374374 var signingKey jwk.Key
375375 var keyset jwk.Set
@@ -512,7 +512,7 @@ import (
512512 " github.com/lestrrat-go/jwx/v3/jwt"
513513)
514514
515- func ExampleJWT_ParseWithKeyProvider_UseToken () {
515+ func Example_jwt_parse_with_key_provider_use_token () {
516516 // This example shows how one might use the information in the JWT to
517517 // load different keys.
518518
@@ -586,7 +586,7 @@ func ExampleJWT_ParseWithKeyProvider_UseToken() {
586586 //
587587}
588588
589- func ExampleJWT_ParseWithKeyProvider () {
589+ func Example_jwt_parse_with_key_provider () {
590590 // Pretend that this is a storage somewhere (maybe a database) that maps
591591 // a signature algorithm to a key
592592 store := make (map [jwa.KeyAlgorithm ]interface {})
@@ -674,7 +674,7 @@ import (
674674 " github.com/lestrrat-go/jwx/v3/jwt"
675675)
676676
677- func ExampleJWT_ParseWithJKU () {
677+ func Example_jwt_parse_with_jku () {
678678 set := jwk.NewSet ()
679679
680680 var signingKey jwk.Key
@@ -761,7 +761,7 @@ import (
761761 " github.com/lestrrat-go/jwx/v3/jwt"
762762)
763763
764- func ExampleJWT_Validate () {
764+ func Example_jwt_validate () {
765765 tok , err := jwt.NewBuilder ().
766766 Issuer (` github.com/lestrrat-go/jwx` ).
767767 Expiration (time.Now ().Add (-1 * time.Hour )).
@@ -821,7 +821,7 @@ import (
821821 " github.com/lestrrat-go/jwx/v3/jwt"
822822)
823823
824- func ExampleJWT_ValidateIssuer () {
824+ func Example_jwt_validate_issuer () {
825825 tok , err := jwt.NewBuilder ().
826826 Issuer (` github.com/lestrrat-go/jwx` ).
827827 Expiration (time.Now ().Add (time.Hour )).
@@ -861,7 +861,7 @@ import (
861861 " github.com/lestrrat-go/jwx/v3/jwt"
862862)
863863
864- func ExampleJWT_ValidateValidator () {
864+ func Example_jwt_validate_validator () {
865865 validator := jwt.ValidatorFunc (func (_ context.Context , t jwt.Token ) error {
866866 iat , ok := t.IssuedAt ()
867867 if !ok {
@@ -912,7 +912,7 @@ import (
912912 " github.com/lestrrat-go/jwx/v3/jwt"
913913)
914914
915- func ExampleJWT_ValidateDetectErrorType () {
915+ func Example_jwt_validate_detect_error_type () {
916916 tok , err := jwt.NewBuilder ().
917917 Issuer (` github.com/lestrrat-go/jwx` ).
918918 Expiration (time.Now ().Add (-1 * time.Hour )).
@@ -994,7 +994,7 @@ import (
994994 " github.com/lestrrat-go/jwx/v3/jwt"
995995)
996996
997- func ExampleJWT_SerializeJSON () {
997+ func Example_jwt_serialize_json () {
998998 tok , err := jwt.NewBuilder ().
999999 Issuer (` github.com/lestrrat-go/jwx` ).
10001000 IssuedAt (time.Unix (aLongLongTimeAgo, 0 )).
@@ -1031,7 +1031,7 @@ import (
10311031 " github.com/lestrrat-go/jwx/v3/jwt"
10321032)
10331033
1034- func ExampleJWT_SerializeJWS () {
1034+ func Example_jwt_serialize_jws () {
10351035 tok , err := jwt.NewBuilder ().
10361036 Issuer (` github.com/lestrrat-go/jwx` ).
10371037 IssuedAt (time.Unix (aLongLongTimeAgo, 0 )).
@@ -1097,7 +1097,7 @@ import (
10971097 " github.com/lestrrat-go/jwx/v3/jwt"
10981098)
10991099
1100- func ExampleJWT_SerializeJWEJWS () {
1100+ func Example_jwt_serialize_jwe_jws () {
11011101 tok , err := jwt.NewBuilder ().
11021102 Issuer (` github.com/lestrrat-go/jwx` ).
11031103 IssuedAt (time.Unix (aLongLongTimeAgo, 0 )).
@@ -1176,7 +1176,7 @@ import (
11761176 " github.com/lestrrat-go/jwx/v3/jwt"
11771177)
11781178
1179- func ExampleJWT_FlattenAudience () {
1179+ func Example_jwt_flatten_Audience () {
11801180 // Sometimes you need to "flatten" the "aud" claim because of
11811181 // parsers developed by people who apparently didn't read the RFC.
11821182 //
@@ -1274,7 +1274,7 @@ import (
12741274 " github.com/lestrrat-go/jwx/v3/jwt"
12751275)
12761276
1277- func ExampleJWTPlainStruct () {
1277+ func Example_jwt_plain_struct () {
12781278 t1 , err := jwt.NewBuilder ().
12791279 Issuer (" https://github.com/lestrrat-go/jwx/v3/examples" ).
12801280 Subject (" raw_struct" ).
0 commit comments