WantsJSON reports whether the resolved mode is JSON or NDJSON. Used by callers to choose between the JSON emit path and text rendering.
()
| 92 | // WantsJSON reports whether the resolved mode is JSON or NDJSON. Used by |
| 93 | // callers to choose between the JSON emit path and text rendering. |
| 94 | func (o *FormatOptions) WantsJSON() bool { |
| 95 | return o.Mode == FormatJSON || o.Mode == FormatNDJSON |
| 96 | } |
| 97 | |
| 98 | // Emit serializes data wrapped in the success envelope (FormatJSON |
| 99 | // path) or as bare NDJSON lines (FormatNDJSON path). meta is optional |
no outgoing calls