CodeQL library for Go
codeql/go-all 4.2.3-dev (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.

getLocation

Gets the location of this callable.

getName

Gets the name of this callable.

getType

Gets the type of this callable.

hasLocationInfo

DEPRECATED: Use getLocation() instead.

toString

Gets a textual representation of this callable.