( st errbase.StackTrace, )
| 61 | } |
| 62 | |
| 63 | func getOneLineSourceFromPkgStack( |
| 64 | st errbase.StackTrace, |
| 65 | ) (file string, line int, fn string, ok bool) { |
| 66 | if len(st) > 0 { |
| 67 | st = st[:1] |
| 68 | // Note: the stack trace logic changed between go 1.11 and 1.12. |
| 69 | // Trying to analyze the frame PCs point-wise will cause |
| 70 | // the output to change between the go versions. |
| 71 | stS := fmt.Sprintf("%+v", st) |
| 72 | return getOneLineSourceFromPrintedStack(stS) |
| 73 | } |
| 74 | return "", 0, "", false |
| 75 | } |
| 76 | |
| 77 | func getOneLineSourceFromPrintedStack(st string) (file string, line int, fn string, ok bool) { |
| 78 | // We only need 3 lines: the function/file/line info will be on the first two lines. |
no test coverage detected
searching dependent graphs…