FormatStack formats the stack trace into a single string.
()
| 70 | |
| 71 | // FormatStack formats the stack trace into a single string. |
| 72 | func (ec *ErrorContext) FormatStack() string { |
| 73 | lines := make([]string, len(ec.stack)) |
| 74 | |
| 75 | for i, pc := range ec.stack { |
| 76 | f := runtime.FuncForPC(pc) |
| 77 | file, line := f.FileLine(pc) |
| 78 | lines[i] = fmt.Sprintf("%s:%d %s", file, line, f.Name()) |
| 79 | } |
| 80 | |
| 81 | return strings.Join(lines, "\n") |
| 82 | } |
| 83 | |
| 84 | func (ec *ErrorContext) applyOptions(opts ...Option) *ErrorContext { |
| 85 | for _, opt := range opts { |
nothing calls this directly
no outgoing calls
no test coverage detected