MCPcopy
hub / github.com/valyala/quicktemplate / StreamJSON

Method StreamJSON

testdata/templates/marshal.qtpl.go:38–72  ·  view source on GitHub ↗

JSON marshaling line testdata/templates/marshal.qtpl:18

(qw422016 *qt422016.Writer)

Source from the content-addressed store, hash-verified

36
37//line testdata/templates/marshal.qtpl:18
38func (d *MarshalData) StreamJSON(qw422016 *qt422016.Writer) {
39//line testdata/templates/marshal.qtpl:18
40 qw422016.N().S(`{"Foo":`)
41//line testdata/templates/marshal.qtpl:20
42 qw422016.N().D(d.Foo)
43//line testdata/templates/marshal.qtpl:20
44 qw422016.N().S(`,"Bar":`)
45//line testdata/templates/marshal.qtpl:21
46 qw422016.N().Q(d.Bar)
47//line testdata/templates/marshal.qtpl:21
48 qw422016.N().S(`,"Rows":[`)
49//line testdata/templates/marshal.qtpl:23
50 for i, r := range d.Rows {
51//line testdata/templates/marshal.qtpl:23
52 qw422016.N().S(`{"Msg":`)
53//line testdata/templates/marshal.qtpl:25
54 qw422016.N().Q(r.Msg)
55//line testdata/templates/marshal.qtpl:25
56 qw422016.N().S(`,"N":`)
57//line testdata/templates/marshal.qtpl:26
58 qw422016.N().D(r.N)
59//line testdata/templates/marshal.qtpl:26
60 qw422016.N().S(`}`)
61//line testdata/templates/marshal.qtpl:28
62 if i+1 < len(d.Rows) {
63//line testdata/templates/marshal.qtpl:28
64 qw422016.N().S(`,`)
65//line testdata/templates/marshal.qtpl:28
66 }
67//line testdata/templates/marshal.qtpl:29
68 }
69//line testdata/templates/marshal.qtpl:29
70 qw422016.N().S(`]}`)
71//line testdata/templates/marshal.qtpl:32
72}
73
74//line testdata/templates/marshal.qtpl:32
75func (d *MarshalData) WriteJSON(qq422016 qtio422016.Writer) {

Callers 1

WriteJSONMethod · 0.95

Calls 4

SMethod · 0.80
NMethod · 0.80
DMethod · 0.80
QMethod · 0.80

Tested by

no test coverage detected