github go-playground/validator v5.6
Release 5.6

latest releases: v10.23.0, v10.22.1, v10.22.0...
9 years ago

Implemented automatic struct and field schema/metadata caching
merged a documentation fix, thanks @xboston

New Performance Numbers!

Original Benchmarks
$ go test -bench=. -benchmem=true
PASS
BenchmarkValidateField   2000000           651 ns/op         176 B/op          5 allocs/op
BenchmarkValidateStruct   200000          6274 ns/op        1584 B/op         37 allocs/op

Optimized No Cache Benchmarks
$ go test -cpu=4 -bench=. -benchmem=true
PASS
BenchmarkValidateField-4             3000000           473 ns/op          80 B/op          4 allocs/op
BenchmarkValidateStructSimple-4       300000          5010 ns/op        1200 B/op         33 allocs/op
BenchmarkTemplateParallelSimple-4    1000000          2185 ns/op        1200 B/op         33 allocs/op
BenchmarkValidateStructLarge-4         50000         28706 ns/op        6980 B/op        201 allocs/op
BenchmarkTemplateParallelLarge-4      200000         14362 ns/op        6983 B/op        201 allocs/op

Optimized Cached Benchmarks
$ go test -cpu=4 -bench=. -benchmem=true
PASS
BenchmarkValidateField-4             5000000           333 ns/op          16 B/op          1 allocs/op
BenchmarkValidateStructSimple-4       500000          2597 ns/op         752 B/op         13 allocs/op
BenchmarkTemplateParallelSimple-4    1000000          1138 ns/op         753 B/op         13 allocs/op
BenchmarkValidateStructLarge-4        100000         14663 ns/op        4806 B/op         78 allocs/op
BenchmarkTemplateParallelLarge-4      200000          7112 ns/op        4810 B/op         78 allocs/op

Don't miss a new validator release

NewReleases is sending notifications on new releases.