parseFunc only return an error if it also returns true. Uses reFunc.
(c *Call, line []byte)
| 817 | // |
| 818 | // Uses reFunc. |
| 819 | func parseFunc(c *Call, line []byte) (bool, error) { |
| 820 | if match := reFunc.FindSubmatch(line); match != nil { |
| 821 | if err := c.Func.Init(string(match[1])); err != nil { |
| 822 | return true, err |
| 823 | } |
| 824 | // It is also done in c.init() but do it here in case of a corrupted trace |
| 825 | // for the file section. |
| 826 | c.ImportPath = c.Func.ImportPath |
| 827 | |
| 828 | args, err := parseArgs(match[2]) |
| 829 | if err != nil { |
| 830 | return true, fmt.Errorf("%s on line: %q", err, bytes.TrimSpace(line)) |
| 831 | } |
| 832 | c.Args = args |
| 833 | return true, nil |
| 834 | } |
| 835 | return false, nil |
| 836 | } |
| 837 | |
| 838 | // parseArgs parses a collection of comma-separated arguments into an Args |
| 839 | // struct. |