mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
d001ac49d2
When sending JSON back to the client — and we do a lot of that, use the streaming implementation of json.Encode rather than marshalling the data into an intermediate byte array. One curious detail here is that the streaming implementation uses newlines to mark the end of the stream, so a few unit tests had to be updated to expect this. Previously we would only emit a trailing newline if "pretty" was configured. Signed-off-by: Anders Eknert <anders@styra.com>