(b *testing.B)
| 47 | } |
| 48 | |
| 49 | func BenchmarkRedactErrorf(b *testing.B) { |
| 50 | fmt := "Couldn't get user %q: " |
| 51 | fmtVerbs := []string{"%s", "%w"} |
| 52 | args := []interface{}{UD("Bob"), ErrNotFound} |
| 53 | |
| 54 | for _, verb := range fmtVerbs { |
| 55 | err := RedactErrorf(fmt+verb, args...) |
| 56 | b.Run(verb+" String()", func(b *testing.B) { |
| 57 | for i := 0; i < b.N; i++ { |
| 58 | _ = err.String() |
| 59 | } |
| 60 | }) |
| 61 | b.Run(verb+" Redact()", func(b *testing.B) { |
| 62 | for i := 0; i < b.N; i++ { |
| 63 | _ = err.Redact() |
| 64 | } |
| 65 | }) |
| 66 | } |
| 67 | } |
nothing calls this directly
no test coverage detected