CodeQL library for Go
codeql/go-all 2.1.3 (changelog, source)
Search

Class Callable

A Function or a FuncLit. We do it this way because of limitations of both Function and FuncDef:

  • Function is an entity, and therefore does not include function literals, and
  • FuncDef is an AST node, and so is not extracted for functions from external libraries.

Import path

import semmle.go.Scopes

Direct supertypes

Predicates

asFuncLit

Gets this callable as a function literal, if it is one.

asFunction

Gets this callable as a function, if it is one.

getFuncDef

Gets this function’s definition, if it exists.

getName

Gets the name of this callable.

getType

Gets the type of this callable.

hasLocationInfo

Holds if this element is at the specified location. The location spans column sc of line sl to column ec of line el in file fp. For more information, see Locations.

toString

Gets a textual representation of this callable.