View definition

func HasEnclosingFunction

Defined in


HasEnclosingFunction returns true if the AST node denoted by path is contained within the declaration of some function or package-level variable.

Unlike EnclosingFunction, the behaviour of this function does not depend on whether SSA code for pkg has been built, so it can be used to quickly reject check inputs that will cause EnclosingFunction to fail, prior to SSA building.