]> Cypherpunks repositories - gostls13.git/commit
encoding/json: add JSON streaming parse API
authorPeter Waldschmidt <peter@waldschmidt.com>
Sat, 18 Apr 2015 07:23:32 +0000 (03:23 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 27 Jul 2015 16:07:39 +0000 (16:07 +0000)
commit0cf48b4d919e5137ec03f1bf230fbd8720873151
tree6ac49553c1df1197f39fc31837c1fa431540ce55
parent9c55792cf1bfa3cd26f9df99f8a251fa1cf3c3b7
encoding/json: add JSON streaming parse API

This change adds new methods to Decoder.

 * Decoder.Token steps through a JSON document, returning a value for each token.
 * Decoder.Decode unmarshals the entire value at the token stream's current
   position (in addition to its existing function in a stream of JSON values)

Fixes #6050.
Fixes #6499.

Change-Id: Iff283e0e7b537221ae256392aca6529f06ebe211
Reviewed-on: https://go-review.googlesource.com/9073
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/json/bench_test.go
src/encoding/json/example_test.go
src/encoding/json/stream.go
src/encoding/json/stream_test.go