-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcached_header_easyjson.go
85 lines (82 loc) · 1.63 KB
/
cached_header_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
84
85
// Code generated by easyjson for marshaling/unmarshaling. Patched by hand.
package imapsql
import (
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
func easyjsonUnmarshalCachedHeader(in *jlexer.Lexer, out map[string][]string) {
isTopLevel := in.IsStart()
if in.IsNull() {
in.Skip()
} else {
in.Delim('{')
if !in.IsDelim('}') {
out = make(map[string][]string)
} else {
out = nil
}
for !in.IsDelim('}') {
key := string(in.String())
in.WantColon()
var v1 []string
if in.IsNull() {
in.Skip()
v1 = nil
} else {
in.Delim('[')
if v1 == nil {
if !in.IsDelim(']') {
v1 = make([]string, 0, 4)
} else {
v1 = []string{}
}
} else {
v1 = (v1)[:0]
}
for !in.IsDelim(']') {
var v2 string
v2 = string(in.String())
v1 = append(v1, v2)
in.WantComma()
}
in.Delim(']')
}
out[key] = v1
in.WantComma()
}
in.Delim('}')
}
if isTopLevel {
in.Consumed()
}
}
func easyjsonMarshalCachedHeader(out *jwriter.Writer, in map[string][]string) {
if in == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
out.RawString(`null`)
} else {
out.RawByte('{')
v3First := true
for v3Name, v3Value := range in {
if v3First {
v3First = false
} else {
out.RawByte(',')
}
out.String(string(v3Name))
out.RawByte(':')
if v3Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v4, v5 := range v3Value {
if v4 > 0 {
out.RawByte(',')
}
out.String(string(v5))
}
out.RawByte(']')
}
}
out.RawByte('}')
}
}