Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: format JSON output to stabilize its output
protojson doesn't guarantee stable JSON output, and deliberately introduce minor differences in output to prevent the illusion of this, see [1]. As this tool generates code, we'd like to keep the output as stable as possible, use the advice in [1] and [2] (at the end) and run the generated JSON through a formatter before including it in the generated code. This also changes from using the error ignoring Format() function to Marshal(). [1]: https://developers.google.com/protocol-buffers/docs/reference/go/faq#unstable-json [2]: golang/protobuf#1121 (comment)
- Loading branch information