Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As suggested by 'mattn, use a `TeeReader` with an `io.Writer` to keep the semantics of `json.NewDecoder().Decode()` whilst also being able to save the JSON if requested by the client. However we need to use our own interface (`WriteResetter`) in order to be able to call `Reset()` on the underlying buffer (which does somewhat limit the usage to buffers instead of generic `io.Writer` and may not be the 100% ideal solution.)
- Loading branch information