@ -3,8 +3,8 @@ Package validator
[![Join the chat at https://gitter.im/bluesuncorp/validator ](https://badges.gitter.im/Join%20Chat.svg )](https://gitter.im/bluesuncorp/validator?utm_source=badge& utm_medium=badge& utm_campaign=pr-badge& utm_content=badge)
[![Join the chat at https://gitter.im/bluesuncorp/validator ](https://badges.gitter.im/Join%20Chat.svg )](https://gitter.im/bluesuncorp/validator?utm_source=badge& utm_medium=badge& utm_campaign=pr-badge& utm_content=badge)
[![Build Status ](https://semaphoreci.com/api/v1/projects/ec20115f-ef1b-4c7d-9393-cc76aba74eb4/487374/badge.svg )](https://semaphoreci.com/joeybloggs/validator)
[![Build Status ](https://semaphoreci.com/api/v1/projects/ec20115f-ef1b-4c7d-9393-cc76aba74eb4/487374/badge.svg )](https://semaphoreci.com/joeybloggs/validator)
[![Coverage Status ](https://coveralls.io/repos/bluesuncorp/validator/badge.svg?branch=v6 )](https://coveralls.io/r/bluesuncorp/validator?branch=v6 )
[![Coverage Status ](https://coveralls.io/repos/bluesuncorp/validator/badge.svg?branch=v7 )](https://coveralls.io/r/bluesuncorp/validator?branch=v7 )
[![GoDoc ](https://godoc.org/gopkg.in/bluesuncorp/validator.v6?status.svg )](https://godoc.org/gopkg.in/bluesuncorp/validator.v6 )
[![GoDoc ](https://godoc.org/gopkg.in/bluesuncorp/validator.v7?status.svg )](https://godoc.org/gopkg.in/bluesuncorp/validator.v7 )
Package validator implements value validations for structs and individual fields based on tags.
Package validator implements value validations for structs and individual fields based on tags.
@ -20,20 +20,20 @@ Installation
Use go get.
Use go get.
go get gopkg.in/bluesuncorp/validator.v6
go get gopkg.in/bluesuncorp/validator.v7
or to update
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.
Then import the validator package into your own code.
import "gopkg.in/bluesuncorp/validator.v6 "
import "gopkg.in/bluesuncorp/validator.v7 "
Usage and documentation
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:
##### Examples:
@ -143,7 +143,7 @@ import (
"fmt"
"fmt"
"reflect"
"reflect"
"gopkg.in/bluesuncorp/validator.v6 "
"gopkg.in/bluesuncorp/validator.v7 "
)
)
// DbBackedUser User struct
// 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
It was a decicion not to cache struct info because although it reduced allocation to v5 levels, it
hurt parallel performance too much.
hurt parallel performance too much.
```go
```go
$ go test -cpu=4 -bench=. -benchmem=true
go test -cpu=4 -bench=. -benchmem=true
PASS
PASS
BenchmarkFieldSuccess-4 5000000 332 ns/op 16 B/op 1 allocs/op
BenchmarkFieldSuccess-4 5000000 332 ns/op 16 B/op 1 allocs/op
BenchmarkFieldFailure-4 5000000 334 ns/op 16 B/op 1 allocs/op
BenchmarkFieldFailure-4 5000000 334 ns/op 16 B/op 1 allocs/op