-
Notifications
You must be signed in to change notification settings - Fork 1
/
WithEmbedStructBase2_json.go
44 lines (42 loc) · 1.46 KB
/
WithEmbedStructBase2_json.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package value_tests
import jsoniter "github.com/json-iterator/tinygo"
type WithEmbedStructBase2_json struct {
}
func (json WithEmbedStructBase2_json) Type() interface{} {
var val WithEmbedStructBase2
return val
}
func (json WithEmbedStructBase2_json) Unmarshal(iter *jsoniter.Iterator, out interface{}) {
WithEmbedStructBase2_json_unmarshal(iter, out.(*WithEmbedStructBase2))
}
func (json WithEmbedStructBase2_json) Marshal(stream *jsoniter.Stream, val interface{}) {
WithEmbedStructBase2_json_marshal(stream, val.(WithEmbedStructBase2))
}
func WithEmbedStructBase2_json_unmarshal(iter *jsoniter.Iterator, out *WithEmbedStructBase2) {
more := iter.ReadObjectHead()
for more {
field := iter.ReadObjectField()
if !WithEmbedStructBase2_json_unmarshal_field(iter, field, out) {
iter.Skip()
}
more = iter.ReadObjectMore()
}
}
func WithEmbedStructBase2_json_unmarshal_field(iter *jsoniter.Iterator, field string, out *WithEmbedStructBase2) bool {
switch {
case field == `Field2`:
iter.ReadString(&(*out).Field2)
return true
}
return false
}
func WithEmbedStructBase2_json_marshal(stream *jsoniter.Stream, val WithEmbedStructBase2) {
stream.WriteObjectHead()
WithEmbedStructBase2_json_marshal_field(stream, val)
stream.WriteObjectTail()
}
func WithEmbedStructBase2_json_marshal_field(stream *jsoniter.Stream, val WithEmbedStructBase2) {
stream.WriteObjectField(`Field2`)
stream.WriteString(val.Field2)
stream.WriteMore()
}