Skip to content

The purpose of io.Copy(ioutil.Discard, r) in render.DecodeJSON #871

Answered by VojtechVitek
haarts asked this question in Q&A
Discussion options

You must be logged in to vote

This is the reason: go-chi/render#42

json.NewDecoder(r).Decode(v) reads the first JSON object only and leaves the rest of the bytes unread in the reader.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@haarts
Comment options

Answer selected by haarts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants