diff options
author | Iccha Sethi <icchasethi@gmail.com> | 2017-07-15 13:28:12 -0500 |
---|---|---|
committer | Dmitri Shuralyov <shurcool@gmail.com> | 2017-07-15 21:35:22 +0000 |
commit | ba6cd156f30ad9d5b42663cdd93e58f0b91b9811 (patch) | |
tree | aa7d457fe8231e7bc5729fed67e21d9db867a05f | |
parent | aad7f7bfb7b088fdcdb51c9e384a5d9a2ea37838 (diff) | |
download | go-ba6cd156f30ad9d5b42663cdd93e58f0b91b9811.tar.gz go-ba6cd156f30ad9d5b42663cdd93e58f0b91b9811.zip |
encoding/json: fix indentation in Decode stream example
The existing example for Decoder.Decode (Stream) had excessive
indentation in the godoc interface for the const jsonStream,
making it hard to read. This fixes the indentation in the
example_test.go to improve the readability in godoc.
Helps #21026.
Change-Id: I16f56b82182da1dcc73cca44e535a7f5695e975d
Reviewed-on: https://go-review.googlesource.com/48910
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/encoding/json/example_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/encoding/json/example_test.go b/src/encoding/json/example_test.go index e4dffd942d..fa1846bb1b 100644 --- a/src/encoding/json/example_test.go +++ b/src/encoding/json/example_test.go @@ -123,14 +123,14 @@ func ExampleDecoder_Token() { // This example uses a Decoder to decode a streaming array of JSON objects. func ExampleDecoder_Decode_stream() { const jsonStream = ` - [ - {"Name": "Ed", "Text": "Knock knock."}, - {"Name": "Sam", "Text": "Who's there?"}, - {"Name": "Ed", "Text": "Go fmt."}, - {"Name": "Sam", "Text": "Go fmt who?"}, - {"Name": "Ed", "Text": "Go fmt yourself!"} - ] - ` + [ + {"Name": "Ed", "Text": "Knock knock."}, + {"Name": "Sam", "Text": "Who's there?"}, + {"Name": "Ed", "Text": "Go fmt."}, + {"Name": "Sam", "Text": "Go fmt who?"}, + {"Name": "Ed", "Text": "Go fmt yourself!"} + ] +` type Message struct { Name, Text string } |