Skip to content

Commit 1fda493

Browse files
joeybloggsjoeybloggs
authored andcommitted
comment out parallel benchmarks to maintain go 1.2 compatibility
1 parent aa275c6 commit 1fda493

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

validator_test.go

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,23 +2341,23 @@ func BenchmarkValidateStructSimple(b *testing.B) {
23412341
}
23422342
}
23432343

2344-
func BenchmarkTemplateParallelSimple(b *testing.B) {
2344+
// func BenchmarkTemplateParallelSimple(b *testing.B) {
23452345

2346-
type Foo struct {
2347-
StringValue string `validate:"min=5,max=10"`
2348-
IntValue int `validate:"min=5,max=10"`
2349-
}
2346+
// type Foo struct {
2347+
// StringValue string `validate:"min=5,max=10"`
2348+
// IntValue int `validate:"min=5,max=10"`
2349+
// }
23502350

2351-
validFoo := &Foo{StringValue: "Foobar", IntValue: 7}
2352-
invalidFoo := &Foo{StringValue: "Fo", IntValue: 3}
2351+
// validFoo := &Foo{StringValue: "Foobar", IntValue: 7}
2352+
// invalidFoo := &Foo{StringValue: "Fo", IntValue: 3}
23532353

2354-
b.RunParallel(func(pb *testing.PB) {
2355-
for pb.Next() {
2356-
validate.Struct(validFoo)
2357-
validate.Struct(invalidFoo)
2358-
}
2359-
})
2360-
}
2354+
// b.RunParallel(func(pb *testing.PB) {
2355+
// for pb.Next() {
2356+
// validate.Struct(validFoo)
2357+
// validate.Struct(invalidFoo)
2358+
// }
2359+
// })
2360+
// }
23612361

23622362
func BenchmarkValidateStructLarge(b *testing.B) {
23632363

@@ -2418,63 +2418,63 @@ func BenchmarkValidateStructLarge(b *testing.B) {
24182418
}
24192419
}
24202420

2421-
func BenchmarkTemplateParallelLarge(b *testing.B) {
2422-
2423-
tFail := &TestString{
2424-
Required: "",
2425-
Len: "",
2426-
Min: "",
2427-
Max: "12345678901",
2428-
MinMax: "",
2429-
Lt: "0123456789",
2430-
Lte: "01234567890",
2431-
Gt: "1",
2432-
Gte: "1",
2433-
OmitEmpty: "12345678901",
2434-
Sub: &SubTest{
2435-
Test: "",
2436-
},
2437-
Anonymous: struct {
2438-
A string `validate:"required"`
2439-
}{
2440-
A: "",
2441-
},
2442-
Iface: &Impl{
2443-
F: "12",
2444-
},
2445-
}
2446-
2447-
tSuccess := &TestString{
2448-
Required: "Required",
2449-
Len: "length==10",
2450-
Min: "min=1",
2451-
Max: "1234567890",
2452-
MinMax: "12345",
2453-
Lt: "012345678",
2454-
Lte: "0123456789",
2455-
Gt: "01234567890",
2456-
Gte: "0123456789",
2457-
OmitEmpty: "",
2458-
Sub: &SubTest{
2459-
Test: "1",
2460-
},
2461-
SubIgnore: &SubTest{
2462-
Test: "",
2463-
},
2464-
Anonymous: struct {
2465-
A string `validate:"required"`
2466-
}{
2467-
A: "1",
2468-
},
2469-
Iface: &Impl{
2470-
F: "123",
2471-
},
2472-
}
2473-
2474-
b.RunParallel(func(pb *testing.PB) {
2475-
for pb.Next() {
2476-
validate.Struct(tSuccess)
2477-
validate.Struct(tFail)
2478-
}
2479-
})
2480-
}
2421+
// func BenchmarkTemplateParallelLarge(b *testing.B) {
2422+
2423+
// tFail := &TestString{
2424+
// Required: "",
2425+
// Len: "",
2426+
// Min: "",
2427+
// Max: "12345678901",
2428+
// MinMax: "",
2429+
// Lt: "0123456789",
2430+
// Lte: "01234567890",
2431+
// Gt: "1",
2432+
// Gte: "1",
2433+
// OmitEmpty: "12345678901",
2434+
// Sub: &SubTest{
2435+
// Test: "",
2436+
// },
2437+
// Anonymous: struct {
2438+
// A string `validate:"required"`
2439+
// }{
2440+
// A: "",
2441+
// },
2442+
// Iface: &Impl{
2443+
// F: "12",
2444+
// },
2445+
// }
2446+
2447+
// tSuccess := &TestString{
2448+
// Required: "Required",
2449+
// Len: "length==10",
2450+
// Min: "min=1",
2451+
// Max: "1234567890",
2452+
// MinMax: "12345",
2453+
// Lt: "012345678",
2454+
// Lte: "0123456789",
2455+
// Gt: "01234567890",
2456+
// Gte: "0123456789",
2457+
// OmitEmpty: "",
2458+
// Sub: &SubTest{
2459+
// Test: "1",
2460+
// },
2461+
// SubIgnore: &SubTest{
2462+
// Test: "",
2463+
// },
2464+
// Anonymous: struct {
2465+
// A string `validate:"required"`
2466+
// }{
2467+
// A: "1",
2468+
// },
2469+
// Iface: &Impl{
2470+
// F: "123",
2471+
// },
2472+
// }
2473+
2474+
// b.RunParallel(func(pb *testing.PB) {
2475+
// for pb.Next() {
2476+
// validate.Struct(tSuccess)
2477+
// validate.Struct(tFail)
2478+
// }
2479+
// })
2480+
// }

0 commit comments

Comments
 (0)