MCPcopy Create free account
hub / github.com/go-playground/validator / BenchmarkStructExceptFailure

Function BenchmarkStructExceptFailure

benchmarks_test.go:634–650  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

632}
633
634func BenchmarkStructExceptFailure(b *testing.B) {
635 validate := New()
636
637 type Test struct {
638 Name string `validate:"required"`
639 NickName string `validate:"required"`
640 }
641
642 test := &Test{
643 Name: "Joey Bloggs",
644 }
645
646 b.ResetTimer()
647 for n := 0; n < b.N; n++ {
648 _ = validate.StructExcept(test, "Name")
649 }
650}
651
652func BenchmarkStructExceptFailureParallel(b *testing.B) {
653 validate := New()

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
StructExceptMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…