MCPcopy Index your code
hub / github.com/maruel/panicparse / newCallLocal

Function newCallLocal

internal/ui_test.go:183–206  ·  view source on GitHub ↗
(f string, a stack.Args, s string, l int)

Source from the content-addressed store, hash-verified

181}
182
183func newCallLocal(f string, a stack.Args, s string, l int) stack.Call {
184 c := stack.Call{Func: newFunc(f), Args: a, RemoteSrcPath: s, Line: l}
185 // Do the equivalent of Call.init().
186 c.SrcName = filepath.Base(c.RemoteSrcPath)
187 c.DirSrc = path.Join(filepath.Base(c.RemoteSrcPath[:len(c.RemoteSrcPath)-len(c.SrcName)-1]), c.SrcName)
188 const goroot = "/goroot/src/"
189 const gopath = "/home/user/go/src/"
190 const gopathmod = "/home/user/go/pkg/mod/"
191 // Do the equivalent of Call.updateLocations().
192 if strings.HasPrefix(s, goroot) {
193 c.LocalSrcPath = s
194 c.RelSrcPath = s[len(goroot):]
195 c.Location = stack.Stdlib
196 } else if strings.HasPrefix(s, gopath) {
197 c.LocalSrcPath = s
198 c.RelSrcPath = s[len(gopath):]
199 c.Location = stack.GOPATH
200 } else if strings.HasPrefix(s, gopathmod) {
201 c.LocalSrcPath = s
202 c.RelSrcPath = s[len(gopathmod):]
203 c.Location = stack.GoPkg
204 }
205 return c
206}
207
208func compareInt(t *testing.T, want, got int) {
209 if want != got {

Callers 3

TestCalcBucketsLengthsFunction · 0.70
TestBucketHeaderFunction · 0.70
TestStackLinesFunction · 0.70

Calls 1

newFuncFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…