@@ -33,7 +33,7 @@ var BakedInValidators = map[string]ValidationFunc{
33
33
"uri" : isURI ,
34
34
}
35
35
36
- func isURI (field interface {}, param string ) bool {
36
+ func isURI (val interface {}, field interface {}, param string ) bool {
37
37
38
38
st := reflect .ValueOf (field )
39
39
@@ -48,7 +48,7 @@ func isURI(field interface{}, param string) bool {
48
48
}
49
49
}
50
50
51
- func isURL (field interface {}, param string ) bool {
51
+ func isURL (val interface {}, field interface {}, param string ) bool {
52
52
53
53
st := reflect .ValueOf (field )
54
54
@@ -72,7 +72,7 @@ func isURL(field interface{}, param string) bool {
72
72
}
73
73
}
74
74
75
- func isEmail (field interface {}, param string ) bool {
75
+ func isEmail (val interface {}, field interface {}, param string ) bool {
76
76
77
77
st := reflect .ValueOf (field )
78
78
@@ -85,7 +85,7 @@ func isEmail(field interface{}, param string) bool {
85
85
}
86
86
}
87
87
88
- func isHsla (field interface {}, param string ) bool {
88
+ func isHsla (val interface {}, field interface {}, param string ) bool {
89
89
90
90
st := reflect .ValueOf (field )
91
91
@@ -98,7 +98,7 @@ func isHsla(field interface{}, param string) bool {
98
98
}
99
99
}
100
100
101
- func isHsl (field interface {}, param string ) bool {
101
+ func isHsl (val interface {}, field interface {}, param string ) bool {
102
102
103
103
st := reflect .ValueOf (field )
104
104
@@ -111,7 +111,7 @@ func isHsl(field interface{}, param string) bool {
111
111
}
112
112
}
113
113
114
- func isRgba (field interface {}, param string ) bool {
114
+ func isRgba (val interface {}, field interface {}, param string ) bool {
115
115
116
116
st := reflect .ValueOf (field )
117
117
@@ -124,7 +124,7 @@ func isRgba(field interface{}, param string) bool {
124
124
}
125
125
}
126
126
127
- func isRgb (field interface {}, param string ) bool {
127
+ func isRgb (val interface {}, field interface {}, param string ) bool {
128
128
129
129
st := reflect .ValueOf (field )
130
130
@@ -137,7 +137,7 @@ func isRgb(field interface{}, param string) bool {
137
137
}
138
138
}
139
139
140
- func isHexcolor (field interface {}, param string ) bool {
140
+ func isHexcolor (val interface {}, field interface {}, param string ) bool {
141
141
142
142
st := reflect .ValueOf (field )
143
143
@@ -150,7 +150,7 @@ func isHexcolor(field interface{}, param string) bool {
150
150
}
151
151
}
152
152
153
- func isHexadecimal (field interface {}, param string ) bool {
153
+ func isHexadecimal (val interface {}, field interface {}, param string ) bool {
154
154
155
155
st := reflect .ValueOf (field )
156
156
@@ -163,7 +163,7 @@ func isHexadecimal(field interface{}, param string) bool {
163
163
}
164
164
}
165
165
166
- func isNumber (field interface {}, param string ) bool {
166
+ func isNumber (val interface {}, field interface {}, param string ) bool {
167
167
168
168
st := reflect .ValueOf (field )
169
169
@@ -176,7 +176,7 @@ func isNumber(field interface{}, param string) bool {
176
176
}
177
177
}
178
178
179
- func isNumeric (field interface {}, param string ) bool {
179
+ func isNumeric (val interface {}, field interface {}, param string ) bool {
180
180
181
181
st := reflect .ValueOf (field )
182
182
@@ -189,7 +189,7 @@ func isNumeric(field interface{}, param string) bool {
189
189
}
190
190
}
191
191
192
- func isAlphanum (field interface {}, param string ) bool {
192
+ func isAlphanum (val interface {}, field interface {}, param string ) bool {
193
193
194
194
st := reflect .ValueOf (field )
195
195
@@ -202,7 +202,7 @@ func isAlphanum(field interface{}, param string) bool {
202
202
}
203
203
}
204
204
205
- func isAlpha (field interface {}, param string ) bool {
205
+ func isAlpha (val interface {}, field interface {}, param string ) bool {
206
206
207
207
st := reflect .ValueOf (field )
208
208
@@ -215,7 +215,7 @@ func isAlpha(field interface{}, param string) bool {
215
215
}
216
216
}
217
217
218
- func hasValue (field interface {}, param string ) bool {
218
+ func hasValue (val interface {}, field interface {}, param string ) bool {
219
219
220
220
st := reflect .ValueOf (field )
221
221
@@ -229,7 +229,7 @@ func hasValue(field interface{}, param string) bool {
229
229
}
230
230
}
231
231
232
- func isGte (field interface {}, param string ) bool {
232
+ func isGte (val interface {}, field interface {}, param string ) bool {
233
233
234
234
st := reflect .ValueOf (field )
235
235
@@ -265,7 +265,7 @@ func isGte(field interface{}, param string) bool {
265
265
}
266
266
}
267
267
268
- func isGt (field interface {}, param string ) bool {
268
+ func isGt (val interface {}, field interface {}, param string ) bool {
269
269
270
270
st := reflect .ValueOf (field )
271
271
@@ -304,7 +304,7 @@ func isGt(field interface{}, param string) bool {
304
304
// length tests whether a variable's length is equal to a given
305
305
// value. For strings it tests the number of characters whereas
306
306
// for maps and slices it tests the number of items.
307
- func hasLengthOf (field interface {}, param string ) bool {
307
+ func hasLengthOf (val interface {}, field interface {}, param string ) bool {
308
308
309
309
st := reflect .ValueOf (field )
310
310
@@ -344,12 +344,12 @@ func hasLengthOf(field interface{}, param string) bool {
344
344
// number. For number types, it's a simple lesser-than test; for
345
345
// strings it tests the number of characters whereas for maps
346
346
// and slices it tests the number of items.
347
- func hasMinOf (field interface {}, param string ) bool {
347
+ func hasMinOf (val interface {}, field interface {}, param string ) bool {
348
348
349
- return isGte (field , param )
349
+ return isGte (val , field , param )
350
350
}
351
351
352
- func isLte (field interface {}, param string ) bool {
352
+ func isLte (val interface {}, field interface {}, param string ) bool {
353
353
354
354
st := reflect .ValueOf (field )
355
355
@@ -385,7 +385,7 @@ func isLte(field interface{}, param string) bool {
385
385
}
386
386
}
387
387
388
- func isLt (field interface {}, param string ) bool {
388
+ func isLt (val interface {}, field interface {}, param string ) bool {
389
389
390
390
st := reflect .ValueOf (field )
391
391
@@ -425,9 +425,9 @@ func isLt(field interface{}, param string) bool {
425
425
// value. For numbers, it's a simple lesser-than test; for
426
426
// strings it tests the number of characters whereas for maps
427
427
// and slices it tests the number of items.
428
- func hasMaxOf (field interface {}, param string ) bool {
428
+ func hasMaxOf (val interface {}, field interface {}, param string ) bool {
429
429
430
- return isLte (field , param )
430
+ return isLte (val , field , param )
431
431
}
432
432
433
433
// asInt retuns the parameter as a int64
0 commit comments