@@ -105,7 +105,7 @@ func (v *Validation) HasErrors() bool {
105105 return len (v .Errors ) > 1
106106}
107107
108- // Return the errors mapped by key.
108+ // ErrorMap Return the errors mapped by key.
109109// If there are multiple validation errors associated with a single key, the
110110// first one "wins". (Typically the first validation will be the more basic).
111111func (v * Validation ) ErrorMap () map [string ]* ValidationError {
@@ -119,23 +119,23 @@ func (v *Validation) Error() *ValidationError {
119119 return NoError
120120}
121121
122- // Test that the argument is non-nil and non-empty (if string or list)
122+ // Required Test that the argument is non-nil and non-empty (if string or list)
123123func (v * Validation ) Required (obj interface {}, key string ) * ValidationResult {
124124 return v .apply (Required {key }, obj )
125125}
126126
127- // Test that the obj is greater than min if obj's type is int
128- func (v * Validation ) Min (obj interface {}, min int , key string ) * ValidationResult {
127+ // Min Test that the obj is greater than min if obj's type is int
128+ func (v * Validation ) Min (obj interface {}, min float64 , key string ) * ValidationResult {
129129 return v .apply (Min {min , key }, obj )
130130}
131131
132- // Test that the obj is less than max if obj's type is int
133- func (v * Validation ) Max (obj interface {}, max int , key string ) * ValidationResult {
132+ // Max Test that the obj is less than max if obj's type is int
133+ func (v * Validation ) Max (obj interface {}, max float64 , key string ) * ValidationResult {
134134 return v .apply (Max {max , key }, obj )
135135}
136136
137- // Test that the obj is between mni and max if obj's type is int
138- func (v * Validation ) Range (obj interface {}, min , max int , key string ) * ValidationResult {
137+ // Range Test that the obj is between mni and max if obj's type is int
138+ func (v * Validation ) Range (obj interface {}, min , max float64 , key string ) * ValidationResult {
139139 return v .apply (Range {Min {Min : min }, Max {Max : max }, key }, obj )
140140}
141141
0 commit comments