MCPcopy Create free account
hub / github.com/cockroachdb/redact / HelperForErrorf

Function HelperForErrorf

markers_print.go:53–55  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

51// Note: This function only works if an error redaction function
52// has been injected with RegisterRedactErrorFn().
53func 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.

Callers 1

TestHelperForErrorfFunction · 0.70

Calls 1

HelperForErrorfFunction · 0.92

Tested by 1

TestHelperForErrorfFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…