-
Notifications
You must be signed in to change notification settings - Fork 0
/
type_array.go
168 lines (132 loc) · 2.76 KB
/
type_array.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package glog
type bools []bool
func (vv bools) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendBool(vv[i])
}
return nil
}
type complex128s []complex128
func (vv complex128s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendComplex128(vv[i])
}
return nil
}
type complex64s []complex64
func (vv complex64s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendComplex128(complex128(vv[i]))
}
return nil
}
type float64s []float64
func (vv float64s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendFloat64(vv[i])
}
return nil
}
type float32s []float32
func (vv float32s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendFloat64(float64(vv[i]))
}
return nil
}
type ints []int
func (vv ints) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendInt64(int64(vv[i]))
}
return nil
}
type int64s []int64
func (vv int64s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendInt64(vv[i])
}
return nil
}
type int32s []int32
func (vv int32s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendInt64(int64(vv[i]))
}
return nil
}
type int16s []int16
func (vv int16s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendInt64(int64(vv[i]))
}
return nil
}
type int8s []int8
func (vv int8s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendInt64(int64(vv[i]))
}
return nil
}
type uints []uint
func (vv uints) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendUnt64(uint64(vv[i]))
}
return nil
}
type uint64s []uint64
func (vv uint64s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendUnt64(vv[i])
}
return nil
}
type uint32s []uint32
func (vv uint32s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendUnt64(uint64(vv[i]))
}
return nil
}
type uint16s []uint16
func (vv uint16s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendUnt64(uint64(vv[i]))
}
return nil
}
type uint8s []uint8
func (vv uint8s) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendUnt64(uint64(vv[i]))
}
return nil
}
type byteArray []byte
func (vv byteArray) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendByte(vv[i])
}
return nil
}
type stringArray []string
func (vv stringArray) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
ae.AppendString(vv[i])
}
return nil
}
type errorArray []error
func (vv errorArray) MarshalGLogArray(ae ArrayEncoder) error {
for i := range vv {
err := vv[i]
if err != nil {
ae.AppendString(err.Error())
} else {
ae.AppendString("<nil>")
}
}
return nil
}