File: allownil.go

package info (click to toggle)
golang-github-tinylib-msgp 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: makefile: 47
file content (233 lines) | stat: -rw-r--r-- 8,355 bytes parent folder | download
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
package _generated

import "time"

//go:generate msgp

type AllowNil0 struct {
	ABool       bool       `msg:"abool,allownil"`
	AInt        int        `msg:"aint,allownil"`
	AInt8       int8       `msg:"aint8,allownil"`
	AInt16      int16      `msg:"aint16,allownil"`
	AInt32      int32      `msg:"aint32,allownil"`
	AInt64      int64      `msg:"aint64,allownil"`
	AUint       uint       `msg:"auint,allownil"`
	AUint8      uint8      `msg:"auint8,allownil"`
	AUint16     uint16     `msg:"auint16,allownil"`
	AUint32     uint32     `msg:"auint32,allownil"`
	AUint64     uint64     `msg:"auint64,allownil"`
	AFloat32    float32    `msg:"afloat32,allownil"`
	AFloat64    float64    `msg:"afloat64,allownil"`
	AComplex64  complex64  `msg:"acomplex64,allownil"`
	AComplex128 complex128 `msg:"acomplex128,allownil"`

	ANamedBool    bool    `msg:"anamedbool,allownil"`
	ANamedInt     int     `msg:"anamedint,allownil"`
	ANamedFloat64 float64 `msg:"anamedfloat64,allownil"`

	AMapStrStr map[string]string `msg:"amapstrstr,allownil"`

	APtrNamedStr *NamedString `msg:"aptrnamedstr,allownil"`

	AString      string `msg:"astring,allownil"`
	ANamedString string `msg:"anamedstring,allownil"`
	AByteSlice   []byte `msg:"abyteslice,allownil"`

	ASliceString      []string      `msg:"aslicestring,allownil"`
	ASliceNamedString []NamedString `msg:"aslicenamedstring,allownil"`

	ANamedStruct    NamedStructAN  `msg:"anamedstruct,allownil"`
	APtrNamedStruct *NamedStructAN `msg:"aptrnamedstruct,allownil"`

	AUnnamedStruct struct {
		A string `msg:"a,allownil"`
	} `msg:"aunnamedstruct,allownil"` // allownil not supported on unnamed struct

	EmbeddableStructAN `msg:",flatten,allownil"` // embed flat

	EmbeddableStruct2AN `msg:"embeddablestruct2,allownil"` // embed non-flat

	AArrayInt [5]int `msg:"aarrayint,allownil"` // not supported

	ATime time.Time `msg:"atime,allownil"`
}

type AllowNil1 struct {
	ABool       []bool       `msg:"abool,allownil"`
	AInt        []int        `msg:"aint,allownil"`
	AInt8       []int8       `msg:"aint8,allownil"`
	AInt16      []int16      `msg:"aint16,allownil"`
	AInt32      []int32      `msg:"aint32,allownil"`
	AInt64      []int64      `msg:"aint64,allownil"`
	AUint       []uint       `msg:"auint,allownil"`
	AUint8      []uint8      `msg:"auint8,allownil"`
	AUint16     []uint16     `msg:"auint16,allownil"`
	AUint32     []uint32     `msg:"auint32,allownil"`
	AUint64     []uint64     `msg:"auint64,allownil"`
	AFloat32    []float32    `msg:"afloat32,allownil"`
	AFloat64    []float64    `msg:"afloat64,allownil"`
	AComplex64  []complex64  `msg:"acomplex64,allownil"`
	AComplex128 []complex128 `msg:"acomplex128,allownil"`

	ANamedBool    []bool    `msg:"anamedbool,allownil"`
	ANamedInt     []int     `msg:"anamedint,allownil"`
	ANamedFloat64 []float64 `msg:"anamedfloat64,allownil"`

	AMapStrStr map[string]string `msg:"amapstrstr,allownil"`

	APtrNamedStr *NamedString `msg:"aptrnamedstr,allownil"`

	AString      []string `msg:"astring,allownil"`
	ANamedString []string `msg:"anamedstring,allownil"`
	AByteSlice   []byte   `msg:"abyteslice,allownil"`

	ASliceString      []string      `msg:"aslicestring,allownil"`
	ASliceNamedString []NamedString `msg:"aslicenamedstring,allownil"`

	ANamedStruct    NamedStructAN  `msg:"anamedstruct,allownil"`
	APtrNamedStruct *NamedStructAN `msg:"aptrnamedstruct,allownil"`

	AUnnamedStruct struct {
		A []string `msg:"a,allownil"`
	} `msg:"aunnamedstruct,allownil"`

	*EmbeddableStructAN `msg:",flatten,allownil"` // embed flat

	*EmbeddableStruct2AN `msg:"embeddablestruct2,allownil"` // embed non-flat

	AArrayInt [5]int `msg:"aarrayint,allownil"` // not supported

	ATime *time.Time `msg:"atime,allownil"`
}

type EmbeddableStructAN struct {
	SomeEmbed []string `msg:"someembed,allownil"`
}

type EmbeddableStruct2AN struct {
	SomeEmbed2 []string `msg:"someembed2,allownil"`
}

type NamedStructAN struct {
	A []string `msg:"a,allownil"`
	B []string `msg:"b,allownil"`
}

type AllowNilHalfFull struct {
	Field00 []string `msg:"field00,allownil"`
	Field01 []string `msg:"field01"`
	Field02 []string `msg:"field02,allownil"`
	Field03 []string `msg:"field03"`
}

type AllowNilLotsOFields struct {
	Field00 []string `msg:"field00,allownil"`
	Field01 []string `msg:"field01,allownil"`
	Field02 []string `msg:"field02,allownil"`
	Field03 []string `msg:"field03,allownil"`
	Field04 []string `msg:"field04,allownil"`
	Field05 []string `msg:"field05,allownil"`
	Field06 []string `msg:"field06,allownil"`
	Field07 []string `msg:"field07,allownil"`
	Field08 []string `msg:"field08,allownil"`
	Field09 []string `msg:"field09,allownil"`
	Field10 []string `msg:"field10,allownil"`
	Field11 []string `msg:"field11,allownil"`
	Field12 []string `msg:"field12,allownil"`
	Field13 []string `msg:"field13,allownil"`
	Field14 []string `msg:"field14,allownil"`
	Field15 []string `msg:"field15,allownil"`
	Field16 []string `msg:"field16,allownil"`
	Field17 []string `msg:"field17,allownil"`
	Field18 []string `msg:"field18,allownil"`
	Field19 []string `msg:"field19,allownil"`
	Field20 []string `msg:"field20,allownil"`
	Field21 []string `msg:"field21,allownil"`
	Field22 []string `msg:"field22,allownil"`
	Field23 []string `msg:"field23,allownil"`
	Field24 []string `msg:"field24,allownil"`
	Field25 []string `msg:"field25,allownil"`
	Field26 []string `msg:"field26,allownil"`
	Field27 []string `msg:"field27,allownil"`
	Field28 []string `msg:"field28,allownil"`
	Field29 []string `msg:"field29,allownil"`
	Field30 []string `msg:"field30,allownil"`
	Field31 []string `msg:"field31,allownil"`
	Field32 []string `msg:"field32,allownil"`
	Field33 []string `msg:"field33,allownil"`
	Field34 []string `msg:"field34,allownil"`
	Field35 []string `msg:"field35,allownil"`
	Field36 []string `msg:"field36,allownil"`
	Field37 []string `msg:"field37,allownil"`
	Field38 []string `msg:"field38,allownil"`
	Field39 []string `msg:"field39,allownil"`
	Field40 []string `msg:"field40,allownil"`
	Field41 []string `msg:"field41,allownil"`
	Field42 []string `msg:"field42,allownil"`
	Field43 []string `msg:"field43,allownil"`
	Field44 []string `msg:"field44,allownil"`
	Field45 []string `msg:"field45,allownil"`
	Field46 []string `msg:"field46,allownil"`
	Field47 []string `msg:"field47,allownil"`
	Field48 []string `msg:"field48,allownil"`
	Field49 []string `msg:"field49,allownil"`
	Field50 []string `msg:"field50,allownil"`
	Field51 []string `msg:"field51,allownil"`
	Field52 []string `msg:"field52,allownil"`
	Field53 []string `msg:"field53,allownil"`
	Field54 []string `msg:"field54,allownil"`
	Field55 []string `msg:"field55,allownil"`
	Field56 []string `msg:"field56,allownil"`
	Field57 []string `msg:"field57,allownil"`
	Field58 []string `msg:"field58,allownil"`
	Field59 []string `msg:"field59,allownil"`
	Field60 []string `msg:"field60,allownil"`
	Field61 []string `msg:"field61,allownil"`
	Field62 []string `msg:"field62,allownil"`
	Field63 []string `msg:"field63,allownil"`
	Field64 []string `msg:"field64,allownil"`
	Field65 []string `msg:"field65,allownil"`
	Field66 []string `msg:"field66,allownil"`
	Field67 []string `msg:"field67,allownil"`
	Field68 []string `msg:"field68,allownil"`
	Field69 []string `msg:"field69,allownil"`
}

type AllowNil10 struct {
	Field00 []string `msg:"field00,allownil"`
	Field01 []string `msg:"field01,allownil"`
	Field02 []string `msg:"field02,allownil"`
	Field03 []string `msg:"field03,allownil"`
	Field04 []string `msg:"field04,allownil"`
	Field05 []string `msg:"field05,allownil"`
	Field06 []string `msg:"field06,allownil"`
	Field07 []string `msg:"field07,allownil"`
	Field08 []string `msg:"field08,allownil"`
	Field09 []string `msg:"field09,allownil"`
}

type NotAllowNil10 struct {
	Field00 []string `msg:"field00"`
	Field01 []string `msg:"field01"`
	Field02 []string `msg:"field02"`
	Field03 []string `msg:"field03"`
	Field04 []string `msg:"field04"`
	Field05 []string `msg:"field05"`
	Field06 []string `msg:"field06"`
	Field07 []string `msg:"field07"`
	Field08 []string `msg:"field08"`
	Field09 []string `msg:"field09"`
}

type AllowNilOmitEmpty struct {
	Field00 []string `msg:"field00,allownil,omitempty"`
	Field01 []string `msg:"field01,allownil"`
}

type AllowNilOmitEmpty2 struct {
	Field00 []string `msg:"field00,allownil,omitempty"`
	Field01 []string `msg:"field01,allownil,omitempty"`
}

// Primitive types cannot have allownil for now.
type NoAllowNil []byte