From ba6cd156f30ad9d5b42663cdd93e58f0b91b9811 Mon Sep 17 00:00:00 2001 From: Iccha Sethi Date: Sat, 15 Jul 2017 13:28:12 -0500 Subject: 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 --- src/encoding/json/example_test.go | 16 ++++++++-------- 1 file 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 } -- cgit v1.2.3-54-g00ecf