add documentation for ne and nefield validation function

#38
pull/39/head
joeybloggs 10 years ago
parent 23c3fa6b63
commit f7f779fb31
  1. 12
      doc.go

@ -197,6 +197,11 @@ Here is a list of the current built in validators:
equal to the parameter given. For slices, arrays, and maps,
validates the number of items. (Usage: eq=10)
ne
For strings & numbers, eq will ensure that the value is not
equal to the parameter given. For slices, arrays, and maps,
validates the number of items. (Usage: eq=10)
gt
For numbers, this will ensure that the value is greater than the
parameter given. For strings, it checks that the string length
@ -233,6 +238,13 @@ Here is a list of the current built in validators:
Validation on Password field using validate.Struct Usage(eqfield=ConfirmPassword)
Validating by field validate.FieldWithValue(password, confirmpassword, "eqfield")
nefield
This will validate the field value against another fields value either within
a struct or passed in field.
usage examples are for ensuring two colors are not the same:
Validation on Color field using validate.Struct Usage(nefield=Color2)
Validating by field validate.FieldWithValue(color1, color2, "nefield")
gtfield
Only valid for Numbers and time.Time types, this will validate the field value
against another fields value either within a struct or passed in field.

Loading…
Cancel
Save