HelperForErrorf is a helper to implement a redaction-aware fmt.Errorf-compatible function in a different package. It formats the string according to the given format and arguments in the same way as Sprintf, but in addition to this if the format contains %w and an error object in the proper argument
(format string, args ...interface{})
| 51 | // Note: This function only works if an error redaction function |
| 52 | // has been injected with RegisterRedactErrorFn(). |
| 53 | func HelperForErrorf(format string, args ...interface{}) (RedactableString, error) { |
| 54 | return rfmt.HelperForErrorf(format, args...) |
| 55 | } |
| 56 | |
| 57 | // Sprintfn produces a RedactableString using the provided |
| 58 | // SafeFormat-alike function. |
searching dependent graphs…