Commit ba6cd156 authored by Iccha Sethi's avatar Iccha Sethi Committed by Dmitri Shuralyov

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/48910Reviewed-by: default avatarDmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent aad7f7bf
...@@ -123,14 +123,14 @@ func ExampleDecoder_Token() { ...@@ -123,14 +123,14 @@ func ExampleDecoder_Token() {
// This example uses a Decoder to decode a streaming array of JSON objects. // This example uses a Decoder to decode a streaming array of JSON objects.
func ExampleDecoder_Decode_stream() { func ExampleDecoder_Decode_stream() {
const jsonStream = ` const jsonStream = `
[ [
{"Name": "Ed", "Text": "Knock knock."}, {"Name": "Ed", "Text": "Knock knock."},
{"Name": "Sam", "Text": "Who's there?"}, {"Name": "Sam", "Text": "Who's there?"},
{"Name": "Ed", "Text": "Go fmt."}, {"Name": "Ed", "Text": "Go fmt."},
{"Name": "Sam", "Text": "Go fmt who?"}, {"Name": "Sam", "Text": "Go fmt who?"},
{"Name": "Ed", "Text": "Go fmt yourself!"} {"Name": "Ed", "Text": "Go fmt yourself!"}
] ]
` `
type Message struct { type Message struct {
Name, Text string Name, Text string
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment