@@ -34,7 +34,7 @@ var BakedInValidators = map[string]ValidationFunc{
3434 "uri" : isURI ,
3535}
3636
37- func isURI (field interface {}, param string ) bool {
37+ func isURI (val interface {}, field interface {}, param string ) bool {
3838
3939 st := reflect .ValueOf (field )
4040
@@ -49,7 +49,7 @@ func isURI(field interface{}, param string) bool {
4949 panic (fmt .Sprintf ("Bad field type %T" , field ))
5050}
5151
52- func isURL (field interface {}, param string ) bool {
52+ func isURL (val interface {}, field interface {}, param string ) bool {
5353
5454 st := reflect .ValueOf (field )
5555
@@ -72,7 +72,7 @@ func isURL(field interface{}, param string) bool {
7272 panic (fmt .Sprintf ("Bad field type %T" , field ))
7373}
7474
75- func isEmail (field interface {}, param string ) bool {
75+ func isEmail (val interface {}, field interface {}, param string ) bool {
7676
7777 st := reflect .ValueOf (field )
7878
@@ -85,7 +85,7 @@ func isEmail(field interface{}, param string) bool {
8585 panic (fmt .Sprintf ("Bad field type %T" , field ))
8686}
8787
88- func isHsla (field interface {}, param string ) bool {
88+ func isHsla (val interface {}, field interface {}, param string ) bool {
8989
9090 st := reflect .ValueOf (field )
9191
@@ -98,7 +98,7 @@ func isHsla(field interface{}, param string) bool {
9898 panic (fmt .Sprintf ("Bad field type %T" , field ))
9999}
100100
101- func isHsl (field interface {}, param string ) bool {
101+ func isHsl (val interface {}, field interface {}, param string ) bool {
102102
103103 st := reflect .ValueOf (field )
104104
@@ -111,7 +111,7 @@ func isHsl(field interface{}, param string) bool {
111111 panic (fmt .Sprintf ("Bad field type %T" , field ))
112112}
113113
114- func isRgba (field interface {}, param string ) bool {
114+ func isRgba (val interface {}, field interface {}, param string ) bool {
115115
116116 st := reflect .ValueOf (field )
117117
@@ -124,7 +124,7 @@ func isRgba(field interface{}, param string) bool {
124124 panic (fmt .Sprintf ("Bad field type %T" , field ))
125125}
126126
127- func isRgb (field interface {}, param string ) bool {
127+ func isRgb (val interface {}, field interface {}, param string ) bool {
128128
129129 st := reflect .ValueOf (field )
130130
@@ -137,7 +137,7 @@ func isRgb(field interface{}, param string) bool {
137137 panic (fmt .Sprintf ("Bad field type %T" , field ))
138138}
139139
140- func isHexcolor (field interface {}, param string ) bool {
140+ func isHexcolor (val interface {}, field interface {}, param string ) bool {
141141
142142 st := reflect .ValueOf (field )
143143
@@ -150,7 +150,7 @@ func isHexcolor(field interface{}, param string) bool {
150150 panic (fmt .Sprintf ("Bad field type %T" , field ))
151151}
152152
153- func isHexadecimal (field interface {}, param string ) bool {
153+ func isHexadecimal (val interface {}, field interface {}, param string ) bool {
154154
155155 st := reflect .ValueOf (field )
156156
@@ -163,7 +163,7 @@ func isHexadecimal(field interface{}, param string) bool {
163163 panic (fmt .Sprintf ("Bad field type %T" , field ))
164164}
165165
166- func isNumber (field interface {}, param string ) bool {
166+ func isNumber (val interface {}, field interface {}, param string ) bool {
167167
168168 st := reflect .ValueOf (field )
169169
@@ -176,7 +176,7 @@ func isNumber(field interface{}, param string) bool {
176176 panic (fmt .Sprintf ("Bad field type %T" , field ))
177177}
178178
179- func isNumeric (field interface {}, param string ) bool {
179+ func isNumeric (val interface {}, field interface {}, param string ) bool {
180180
181181 st := reflect .ValueOf (field )
182182
@@ -189,7 +189,7 @@ func isNumeric(field interface{}, param string) bool {
189189 panic (fmt .Sprintf ("Bad field type %T" , field ))
190190}
191191
192- func isAlphanum (field interface {}, param string ) bool {
192+ func isAlphanum (val interface {}, field interface {}, param string ) bool {
193193
194194 st := reflect .ValueOf (field )
195195
@@ -202,7 +202,7 @@ func isAlphanum(field interface{}, param string) bool {
202202 panic (fmt .Sprintf ("Bad field type %T" , field ))
203203}
204204
205- func isAlpha (field interface {}, param string ) bool {
205+ func isAlpha (val interface {}, field interface {}, param string ) bool {
206206
207207 st := reflect .ValueOf (field )
208208
@@ -215,7 +215,7 @@ func isAlpha(field interface{}, param string) bool {
215215 panic (fmt .Sprintf ("Bad field type %T" , field ))
216216}
217217
218- func hasValue (field interface {}, param string ) bool {
218+ func hasValue (val interface {}, field interface {}, param string ) bool {
219219
220220 st := reflect .ValueOf (field )
221221
@@ -229,7 +229,7 @@ func hasValue(field interface{}, param string) bool {
229229 }
230230}
231231
232- func isGte (field interface {}, param string ) bool {
232+ func isGte (val interface {}, field interface {}, param string ) bool {
233233
234234 st := reflect .ValueOf (field )
235235
@@ -274,7 +274,7 @@ func isGte(field interface{}, param string) bool {
274274 panic (fmt .Sprintf ("Bad field type %T" , field ))
275275}
276276
277- func isGt (field interface {}, param string ) bool {
277+ func isGt (val interface {}, field interface {}, param string ) bool {
278278
279279 st := reflect .ValueOf (field )
280280
@@ -318,7 +318,7 @@ func isGt(field interface{}, param string) bool {
318318// length tests whether a variable's length is equal to a given
319319// value. For strings it tests the number of characters whereas
320320// for maps and slices it tests the number of items.
321- func hasLengthOf (field interface {}, param string ) bool {
321+ func hasLengthOf (val interface {}, field interface {}, param string ) bool {
322322
323323 st := reflect .ValueOf (field )
324324
@@ -357,12 +357,12 @@ func hasLengthOf(field interface{}, param string) bool {
357357// number. For number types, it's a simple lesser-than test; for
358358// strings it tests the number of characters whereas for maps
359359// and slices it tests the number of items.
360- func hasMinOf (field interface {}, param string ) bool {
360+ func hasMinOf (val interface {}, field interface {}, param string ) bool {
361361
362- return isGte (field , param )
362+ return isGte (val , field , param )
363363}
364364
365- func isLte (field interface {}, param string ) bool {
365+ func isLte (val interface {}, field interface {}, param string ) bool {
366366
367367 st := reflect .ValueOf (field )
368368
@@ -407,7 +407,7 @@ func isLte(field interface{}, param string) bool {
407407 panic (fmt .Sprintf ("Bad field type %T" , field ))
408408}
409409
410- func isLt (field interface {}, param string ) bool {
410+ func isLt (val interface {}, field interface {}, param string ) bool {
411411
412412 st := reflect .ValueOf (field )
413413
@@ -453,9 +453,9 @@ func isLt(field interface{}, param string) bool {
453453// value. For numbers, it's a simple lesser-than test; for
454454// strings it tests the number of characters whereas for maps
455455// and slices it tests the number of items.
456- func hasMaxOf (field interface {}, param string ) bool {
456+ func hasMaxOf (val interface {}, field interface {}, param string ) bool {
457457
458- return isLte (field , param )
458+ return isLte (val , field , param )
459459}
460460
461461// asInt retuns the parameter as a int64
0 commit comments