Syntax returns an ast.Node whose Pos/End methods provide the lexical extent of the function if it was defined by Go source code (f.Synthetic==""), or nil otherwise.

If f was built with debug information (see Package.SetDebugRef), the result is the *ast.FuncDecl or *ast.FuncLit that declared the function. Otherwise, it is an opaque Node providing only position information; this avoids pinning the AST in memory.