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

Method augmentGoroutine

stack/source.go:34–57  ·  view source on GitHub ↗

augmentGoroutine processes source files to improve call to be more descriptive. It modifies the routine.

(g *Goroutine)

Source from the content-addressed store, hash-verified

32//
33// It modifies the routine.
34func (c *cacheAST) augmentGoroutine(g *Goroutine) error {
35 var err error
36 for i, call := range g.Stack.Calls {
37 // Only load the AST if there's an argument to process.
38 if len(call.Args.Values) == 0 {
39 continue
40 }
41 if err1 := c.loadFile(g.Stack.Calls[i].LocalSrcPath); err1 != nil {
42 //log.Printf("%s", err)
43 err = err1
44 }
45 if p := c.parsed[call.LocalSrcPath]; p != nil {
46 f, err1 := p.getFuncAST(call.Func.Name, call.Line)
47 if err1 != nil {
48 err = err1
49 continue
50 }
51 if f != nil {
52 augmentCall(&g.Stack.Calls[i], f)
53 }
54 }
55 }
56 return err
57}
58
59// loadFile loads a Go source file and parses the AST tree.
60func (c *cacheAST) loadFile(fileName string) error {

Callers 1

augmentMethod · 0.95

Calls 3

loadFileMethod · 0.95
augmentCallFunction · 0.85
getFuncASTMethod · 0.80

Tested by

no test coverage detected