]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: fix indentation in Decode stream example
authorIccha Sethi <icchasethi@gmail.com>
Sat, 15 Jul 2017 18:28:12 +0000 (13:28 -0500)
committerDmitri Shuralyov <shurcool@gmail.com>
Sat, 15 Jul 2017 21:35:22 +0000 (21:35 +0000)
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>
src/encoding/json/example_test.go

index e4dffd942d73b557ddf758a9a9ba0ffd9ef9e03d..fa1846bb1b8ac682f2df48ff7c8498165eaed7ed 100644 (file)
@@ -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
        }