@@ -33,7 +33,7 @@ var BakedInValidators = map[string]ValidationFunc{
3333 "uri" : isURI ,
3434}
3535
36- func isURI (field interface {}, param string ) bool {
36+ func isURI (val interface {}, field interface {}, param string ) bool {
3737
3838 st := reflect .ValueOf (field )
3939
@@ -48,7 +48,7 @@ func isURI(field interface{}, param string) bool {
4848 }
4949}
5050
51- func isURL (field interface {}, param string ) bool {
51+ func isURL (val interface {}, field interface {}, param string ) bool {
5252
5353 st := reflect .ValueOf (field )
5454
@@ -72,7 +72,7 @@ func isURL(field interface{}, param string) bool {
7272 }
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 }
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 }
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 }
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 }
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 }
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 }
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 }
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 }
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 }
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 }
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 }
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
@@ -265,7 +265,7 @@ func isGte(field interface{}, param string) bool {
265265 }
266266}
267267
268- func isGt (field interface {}, param string ) bool {
268+ func isGt (val interface {}, field interface {}, param string ) bool {
269269
270270 st := reflect .ValueOf (field )
271271
@@ -304,7 +304,7 @@ func isGt(field interface{}, param string) bool {
304304// length tests whether a variable's length is equal to a given
305305// value. For strings it tests the number of characters whereas
306306// 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 {
308308
309309 st := reflect .ValueOf (field )
310310
@@ -344,12 +344,12 @@ func hasLengthOf(field interface{}, param string) bool {
344344// number. For number types, it's a simple lesser-than test; for
345345// strings it tests the number of characters whereas for maps
346346// 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 {
348348
349- return isGte (field , param )
349+ return isGte (val , field , param )
350350}
351351
352- func isLte (field interface {}, param string ) bool {
352+ func isLte (val interface {}, field interface {}, param string ) bool {
353353
354354 st := reflect .ValueOf (field )
355355
@@ -385,7 +385,7 @@ func isLte(field interface{}, param string) bool {
385385 }
386386}
387387
388- func isLt (field interface {}, param string ) bool {
388+ func isLt (val interface {}, field interface {}, param string ) bool {
389389
390390 st := reflect .ValueOf (field )
391391
@@ -425,9 +425,9 @@ func isLt(field interface{}, param string) bool {
425425// value. For numbers, it's a simple lesser-than test; for
426426// strings it tests the number of characters whereas for maps
427427// 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 {
429429
430- return isLte (field , param )
430+ return isLte (val , field , param )
431431}
432432
433433// asInt retuns the parameter as a int64
0 commit comments