From: Iccha Sethi Date: Sat, 15 Jul 2017 18:28:12 +0000 (-0500) Subject: encoding/json: fix indentation in Decode stream example X-Git-Tag: go1.9rc1~42 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ba6cd156f30ad9d5b42663cdd93e58f0b91b9811;p=gostls13.git 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 Reviewed-by: Brad Fitzpatrick --- 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 }