Print a json object in accordance with the prophecy (or the command line options)
(j any)
| 101 | |
| 102 | // Print a json object in accordance with the prophecy (or the command line options) |
| 103 | func 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. |
no outgoing calls
no test coverage detected