/
gConf_easyjson.go
83 lines (75 loc) · 2.06 KB
/
gConf_easyjson.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package conf
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonEae1800fDecodeGithubComKingsgrouposArchivistLibGoOverwriteConf(in *jlexer.Lexer, out *GConf) {
isTopLevel := in.IsStart()
if in.IsNull() {
in.Skip()
} else {
in.Delim('{')
*out = make(GConf)
for !in.IsDelim('}') {
key := string(in.String())
in.WantColon()
var v1 int64
v1 = int64(in.Int64())
(*out)[key] = v1
in.WantComma()
}
in.Delim('}')
}
if isTopLevel {
in.Consumed()
}
}
func easyjsonEae1800fEncodeGithubComKingsgrouposArchivistLibGoOverwriteConf(out *jwriter.Writer, in GConf) {
if in == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
out.RawString(`null`)
} else {
out.RawByte('{')
v2First := true
for v2Name, v2Value := range in {
if v2First {
v2First = false
} else {
out.RawByte(',')
}
out.String(string(v2Name))
out.RawByte(':')
out.Int64(int64(v2Value))
}
out.RawByte('}')
}
}
// MarshalJSON supports json.Marshaler interface
func (v GConf) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonEae1800fEncodeGithubComKingsgrouposArchivistLibGoOverwriteConf(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GConf) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonEae1800fEncodeGithubComKingsgrouposArchivistLibGoOverwriteConf(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GConf) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonEae1800fDecodeGithubComKingsgrouposArchivistLibGoOverwriteConf(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GConf) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonEae1800fDecodeGithubComKingsgrouposArchivistLibGoOverwriteConf(l, v)
}