mirror of https://github.com/golang/go.git
encoding/json: de-indent raw strings in remaining examples
This change fixes the remaining examples where the raw strings had suboptimal indentation (one level too many) when viewed in godoc. Follows CL 48910. Fixes #21026. Change-Id: Ifc0dae3fa899a9fff8b1ff958414e2fe6852321d Reviewed-on: https://go-review.googlesource.com/50990 Run-TryBot: Dmitri Shuralyov <shurcool@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
6dae588a06
commit
c4e29bbd38
|
|
@ -38,7 +38,7 @@ func ExampleUnmarshal() {
|
|||
var jsonBlob = []byte(`[
|
||||
{"Name": "Platypus", "Order": "Monotremata"},
|
||||
{"Name": "Quoll", "Order": "Dasyuromorphia"}
|
||||
]`)
|
||||
]`)
|
||||
type Animal struct {
|
||||
Name string
|
||||
Order string
|
||||
|
|
@ -61,7 +61,7 @@ func ExampleDecoder() {
|
|||
{"Name": "Ed", "Text": "Go fmt."}
|
||||
{"Name": "Sam", "Text": "Go fmt who?"}
|
||||
{"Name": "Ed", "Text": "Go fmt yourself!"}
|
||||
`
|
||||
`
|
||||
type Message struct {
|
||||
Name, Text string
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ func ExampleDecoder() {
|
|||
func ExampleDecoder_Token() {
|
||||
const jsonStream = `
|
||||
{"Message": "Hello", "Array": [1, 2, 3], "Null": null, "Number": 1.234}
|
||||
`
|
||||
`
|
||||
dec := json.NewDecoder(strings.NewReader(jsonStream))
|
||||
for {
|
||||
t, err := dec.Token()
|
||||
|
|
@ -193,7 +193,7 @@ func ExampleRawMessage_unmarshal() {
|
|||
var j = []byte(`[
|
||||
{"Space": "YCbCr", "Point": {"Y": 255, "Cb": 0, "Cr": -10}},
|
||||
{"Space": "RGB", "Point": {"R": 98, "G": 218, "B": 255}}
|
||||
]`)
|
||||
]`)
|
||||
var colors []Color
|
||||
err := json.Unmarshal(j, &colors)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue