MCPcopy Index your code
hub / github.com/cockroachdb/errors / getOneLineSourceFromPrintedStack

Function getOneLineSourceFromPrintedStack

withstack/one_line_source.go:77–89  ·  view source on GitHub ↗
(st string)

Source from the content-addressed store, hash-verified

75}
76
77func 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.
79 // See parsePrintedStack() for details.
80 lines := strings.SplitN(strings.TrimSpace(st), "\n", 3)
81 if len(lines) > 0 {
82 _, file, line, fnName := parsePrintedStackEntry(lines, 0)
83 if fnName != "unknown" {
84 _, fn = functionName(fnName)
85 }
86 return filepath.Base(file), line, fn, true
87 }
88 return "", 0, "", false
89}

Callers 2

GetOneLineSourceFunction · 0.85

Calls 2

parsePrintedStackEntryFunction · 0.85
functionNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…