File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,38 @@ func BenchmarkStructPartialFailure(b *testing.B) {
153153 }
154154}
155155
156+ func BenchmarkStructExceptSuccess (b * testing.B ) {
157+
158+ type Test struct {
159+ Name string `validate:"required"`
160+ NickName string `validate:"required"`
161+ }
162+
163+ test := & Test {
164+ Name : "Joey Bloggs" ,
165+ }
166+
167+ for n := 0 ; n < b .N ; n ++ {
168+ validate .StructPartial (test , "Nickname" )
169+ }
170+ }
171+
172+ func BenchmarkStructExceptFailure (b * testing.B ) {
173+
174+ type Test struct {
175+ Name string `validate:"required"`
176+ NickName string `validate:"required"`
177+ }
178+
179+ test := & Test {
180+ Name : "Joey Bloggs" ,
181+ }
182+
183+ for n := 0 ; n < b .N ; n ++ {
184+ validate .StructPartial (test , "Name" )
185+ }
186+ }
187+
156188func BenchmarkStructSimpleCrossFieldSuccess (b * testing.B ) {
157189
158190 type Test struct {
You can’t perform that action at this time.
0 commit comments