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

Function getOneLineSourceFromPkgStack

withstack/one_line_source.go:63–75  ·  view source on GitHub ↗
(
	st errbase.StackTrace,
)

Source from the content-addressed store, hash-verified

61}
62
63func 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
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.

Callers 1

GetOneLineSourceFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…