MCPcopy
hub / github.com/golang-jwt/jwt / BenchmarkToken_SigningString

Function BenchmarkToken_SigningString

token_test.go:62–78  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

60}
61
62func BenchmarkToken_SigningString(b *testing.B) {
63 t := &jwt.Token{
64 Method: jwt.SigningMethodHS256,
65 Header: map[string]any{
66 "typ": "JWT",
67 "alg": jwt.SigningMethodHS256.Alg(),
68 },
69 Claims: jwt.RegisteredClaims{},
70 }
71 b.Run("BenchmarkToken_SigningString", func(b *testing.B) {
72 b.ResetTimer()
73 b.ReportAllocs()
74 for i := 0; i < b.N; i++ {
75 _, _ = t.SigningString()
76 }
77 })
78}

Callers

nothing calls this directly

Calls 2

SigningStringMethod · 0.95
AlgMethod · 0.65

Tested by

no test coverage detected