axw/gocov

gocov ignores function literals

axw opened this issue · 1 comments

axw commented
gocov ignores function literals
axw commented

Fixed by c26f32d

From the commit:

Function literals defined within a function will have their
statements counted towards the enclosing function.

Function literals defined outside of a function (i.e. in a
file-level var decl) will have a *gocov.Function created with
a name with the format "@line:column"

There's a minor issue in that statements are no longer in line order, as FuncLits are handled after the statements of the function body in which they're defined. This means annotate.go had to change slightly to accomodate the fact, and may lead to a minor slow-down when checking if lines are hit.