AddGoroutineStack adds the current goroutine stack.
()
| 91 | |
| 92 | // AddGoroutineStack adds the current goroutine stack. |
| 93 | func (di *Info) AddGoroutineStack() { |
| 94 | buf := new(bytes.Buffer) |
| 95 | err := pprof.Lookup("goroutine").WriteTo(buf, 1) |
| 96 | if err != nil { |
| 97 | di.AddSection( |
| 98 | "Goroutine Stack", |
| 99 | NoFlags, |
| 100 | fmt.Sprintf("Failed to get: %s", err), |
| 101 | ) |
| 102 | return |
| 103 | } |
| 104 | |
| 105 | // Add section. |
| 106 | di.AddSection( |
| 107 | "Goroutine Stack", |
| 108 | UseCodeSection, |
| 109 | buf.String(), |
| 110 | ) |
| 111 | } |
| 112 | |
| 113 | // AddLastUnexpectedLogs adds the last 10 unexpected log lines, if any. |
| 114 | func (di *Info) AddLastUnexpectedLogs() { |
no test coverage detected