augmentGoroutine processes source files to improve call to be more descriptive. It modifies the routine.
(g *Goroutine)
| 32 | // |
| 33 | // It modifies the routine. |
| 34 | func (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. |
| 60 | func (c *cacheAST) loadFile(fileName string) error { |
no test coverage detected