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

Module Scopes

Provides classes for working with scopes and declared objects.

Import path

import semmle.go.Scopes

Imports

go

Provides classes for working with Go programs.

Classes

BuiltinConstant

A built-in constant.

BuiltinEntity

A built-in entity (that is, type, constant or function).

BuiltinFunction

A built-in function.

BuiltinType

A built-in named type.

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.

Constant

A built-in or declared constant.

DeclaredConstant

A declared constant.

DeclaredEntity

A declared entity (that is, type, constant, variable or function).

DeclaredFunction

A declared function.

DeclaredType

A declared named type.

DeclaredVariable

A declared variable.

Entity

A declared or built-in entity (that is, package, type, constant, variable, function or label)

Field

A struct field.

FileScope

A local scope induced by a file.

Function

A built-in or declared function.

FunctionScope

A local scope induced by a function definition.

Label

A statement label.

LocalScope

A local scope.

LocalVariable

A variable declared in a local scope (as opposed to a package scope or the universal scope).

Method

A method, that is, a function with a receiver variable, or a function declared in an interface.

PackageEntity

An imported package.

PackageScope

A package scope.

Parameter

A (named) function parameter.

PromotedField

A field that belongs to a struct that may be embedded within another struct.

PromotedMethod

A method whose receiver may be embedded within a struct.

ReceiverVariable

The receiver variable of a method.

ResultVariable

A (named) function result variable.

Scope

A scope.

TypeEntity

A built-in or declared named type.

UniverseScope

The universe scope.

ValueEntity

A built-in or declared constant, variable, field, method or function.

Variable

A built-in or declared variable.

Modules

Builtin

Provides helper predicates for working with built-in objects from the universe scope.

Scope

Provides helper predicates for working with scopes.