corrected some spelling mistakes in documentation

pull/252/head
joeybloggs 8 years ago
parent 1d3a3d281b
commit 77f59a0ea0
  1. 12
      baked_in.go
  2. 2
      doc.go
  3. 4
      util.go
  4. 2
      validator_test.go

@ -300,25 +300,25 @@ func IsISBN10(v *Validate, topStruct reflect.Value, currentStructOrField reflect
return checksum%11 == 0
}
// ExcludesRune is the validation function for validating that the field's value does not contain the rune specified withing the param.
// ExcludesRune is the validation function for validating that the field's value does not contain the rune specified within the param.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func ExcludesRune(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
return !ContainsRune(v, topStruct, currentStructOrField, field, fieldType, fieldKind, param)
}
// ExcludesAll is the validation function for validating that the field's value does not contain any of the characters specified withing the param.
// ExcludesAll is the validation function for validating that the field's value does not contain any of the characters specified within the param.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func ExcludesAll(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
return !ContainsAny(v, topStruct, currentStructOrField, field, fieldType, fieldKind, param)
}
// Excludes is the validation function for validating that the field's value does not contain the text specified withing the param.
// Excludes is the validation function for validating that the field's value does not contain the text specified within the param.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func Excludes(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
return !Contains(v, topStruct, currentStructOrField, field, fieldType, fieldKind, param)
}
// ContainsRune is the validation function for validating that the field's value contains the rune specified withing the param.
// ContainsRune is the validation function for validating that the field's value contains the rune specified within the param.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func ContainsRune(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
r, _ := utf8.DecodeRuneInString(param)
@ -326,13 +326,13 @@ func ContainsRune(v *Validate, topStruct reflect.Value, currentStructOrField ref
return strings.ContainsRune(field.String(), r)
}
// ContainsAny is the validation function for validating that the field's value contains any of the characters specified withing the param.
// ContainsAny is the validation function for validating that the field's value contains any of the characters specified within the param.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func ContainsAny(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
return strings.ContainsAny(field.String(), param)
}
// Contains is the validation function for validating that the field's value contains the text specified withing the param.
// Contains is the validation function for validating that the field's value contains the text specified within the param.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func Contains(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
return strings.Contains(field.String(), param)

@ -162,7 +162,7 @@ Here is a list of the current built in validators:
Skip Field
Tells the validation to skip this struct field; this is particularily
Tells the validation to skip this struct field; this is particularly
handy in ignoring embedded structs from being validated. (Usage: -)
Usage: -

@ -82,7 +82,7 @@ func (v *Validate) extractTypeInternal(current reflect.Value, nullable bool) (re
// GetStructFieldOK traverses a struct to retrieve a specific field denoted by the provided namespace and
// returns the field, field kind and whether is was successful in retrieving the field at all.
// NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field
// could not be retrived because it didn't exist.
// could not be retrieved because it didn't exist.
func (v *Validate) GetStructFieldOK(current reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool) {
current, kind := v.ExtractType(current)
@ -215,7 +215,7 @@ func (v *Validate) GetStructFieldOK(current reflect.Value, namespace string) (re
panic("Invalid field namespace")
}
// asInt retuns the parameter as a int64
// asInt returns the parameter as a int64
// or panics if it can't convert
func asInt(param string) int64 {

@ -723,7 +723,7 @@ func TestStructPartial(t *testing.T) {
errs = validate.StructPartial(tPartial, p2...)
Equal(t, errs, nil)
// this isnt really a robust test, but is ment to illustrate the ANON CASE below
// this isn't really a robust test, but is ment to illustrate the ANON CASE below
errs = validate.StructPartial(tPartial.SubSlice[0], p3...)
Equal(t, errs, nil)

Loading…
Cancel
Save