mirror of
https://github.com/Fishwaldo/validator.git
synced 2025-03-15 19:51:38 +00:00
Merge branch 'v6-development' into merge
Conflicts: README.md baked_in.go benchmarks_test.go util.go validator_test.go Changes to be committed: modified: README.md modified: baked_in.go
This commit is contained in:
commit
3f4f84c358
2 changed files with 9 additions and 9 deletions
16
README.md
16
README.md
|
@ -3,8 +3,8 @@ Package validator
|
|||
|
||||
[](https://gitter.im/bluesuncorp/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://semaphoreci.com/joeybloggs/validator)
|
||||
[](https://coveralls.io/r/bluesuncorp/validator?branch=v6)
|
||||
[](https://godoc.org/gopkg.in/bluesuncorp/validator.v6)
|
||||
[](https://coveralls.io/r/bluesuncorp/validator?branch=v7)
|
||||
[](https://godoc.org/gopkg.in/bluesuncorp/validator.v7)
|
||||
|
||||
Package validator implements value validations for structs and individual fields based on tags.
|
||||
|
||||
|
@ -20,20 +20,20 @@ Installation
|
|||
|
||||
Use go get.
|
||||
|
||||
go get gopkg.in/bluesuncorp/validator.v6
|
||||
go get gopkg.in/bluesuncorp/validator.v7
|
||||
|
||||
or to update
|
||||
|
||||
go get -u gopkg.in/bluesuncorp/validator.v6
|
||||
go get -u gopkg.in/bluesuncorp/validator.v7
|
||||
|
||||
Then import the validator package into your own code.
|
||||
|
||||
import "gopkg.in/bluesuncorp/validator.v6"
|
||||
import "gopkg.in/bluesuncorp/validator.v7"
|
||||
|
||||
Usage and documentation
|
||||
------
|
||||
|
||||
Please see http://godoc.org/gopkg.in/bluesuncorp/validator.v6 for detailed usage docs.
|
||||
Please see http://godoc.org/gopkg.in/bluesuncorp/validator.v7 for detailed usage docs.
|
||||
|
||||
##### Examples:
|
||||
|
||||
|
@ -143,7 +143,7 @@ import (
|
|||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"gopkg.in/bluesuncorp/validator.v6"
|
||||
"gopkg.in/bluesuncorp/validator.v7"
|
||||
)
|
||||
|
||||
// DbBackedUser User struct
|
||||
|
@ -192,7 +192,7 @@ NOTE: allocations for structs are up from v5, however ns/op for parallel operati
|
|||
It was a decicion not to cache struct info because although it reduced allocation to v5 levels, it
|
||||
hurt parallel performance too much.
|
||||
```go
|
||||
$ go test -cpu=4 -bench=. -benchmem=true
|
||||
go test -cpu=4 -bench=. -benchmem=true
|
||||
PASS
|
||||
BenchmarkFieldSuccess-4 5000000 332 ns/op 16 B/op 1 allocs/op
|
||||
BenchmarkFieldFailure-4 5000000 334 ns/op 16 B/op 1 allocs/op
|
||||
|
|
|
@ -1023,7 +1023,7 @@ func isLt(v *Validate, topStruct reflect.Value, currentStruct reflect.Value, fie
|
|||
// value. For numbers, it's a simple lesser-than test; for
|
||||
// strings it tests the number of characters whereas for maps
|
||||
// and slices it tests the number of items.
|
||||
func hasMaxOf(v *Validate, topStruct reflect.Value, currentStruct reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
|
||||
|
||||
func hasMaxOf(v *Validate, topStruct reflect.Value, currentStruct reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
|
||||
return isLte(v, topStruct, currentStruct, field, fieldType, fieldKind, param)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue