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

Function printJSON

cmd/jwt/main.go:103–118  ·  view source on GitHub ↗

Print a json object in accordance with the prophecy (or the command line options)

(j any)

Source from the content-addressed store, hash-verified

101
102// Print a json object in accordance with the prophecy (or the command line options)
103func printJSON(j any) error {
104 var out []byte
105 var err error
106
107 if !*flagCompact {
108 out, err = json.MarshalIndent(j, "", " ")
109 } else {
110 out, err = json.Marshal(j)
111 }
112
113 if err == nil {
114 fmt.Println(string(out))
115 }
116
117 return err
118}
119
120// Verify a token and output the claims. This is a great example
121// of how to verify and view a token.

Callers 2

verifyTokenFunction · 0.85
showTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected