FormatString writes the return trace for err to a string. Any error that has a method `TracePC() uintptr` will contribute to the trace. See [Format] for details of the output format.
(target error)
| 97 | // contribute to the trace. |
| 98 | // See [Format] for details of the output format. |
| 99 | func FormatString(target error) string { |
| 100 | var s strings.Builder |
| 101 | _ = Format(&s, target) |
| 102 | return s.String() |
| 103 | } |
| 104 | |
| 105 | type errTrace struct { |
| 106 | err error |