We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad39bb9 commit 81ce302Copy full SHA for 81ce302
validator_test.go
@@ -2377,3 +2377,21 @@ func BenchmarkValidateStruct(b *testing.B) {
2377
validate.Struct(invalidFoo)
2378
}
2379
2380
+
2381
+func BenchmarkTemplateParallel(b *testing.B) {
2382
2383
+ type Foo struct {
2384
+ StringValue string `validate:"min=5,max=10"`
2385
+ IntValue int `validate:"min=5,max=10"`
2386
+ }
2387
2388
+ validFoo := &Foo{StringValue: "Foobar", IntValue: 7}
2389
+ invalidFoo := &Foo{StringValue: "Fo", IntValue: 3}
2390
2391
+ b.RunParallel(func(pb *testing.PB) {
2392
+ for pb.Next() {
2393
+ validate.Struct(validFoo)
2394
+ validate.Struct(invalidFoo)
2395
2396
+ })
2397
+}
0 commit comments