Namespace: go.std.go.types




Provides a low-level interface to the go/types package.

Package types declares the data types and implements
the algorithms for type-checking of Go packages. Use
Config.Check to invoke the type checker for a package.
Alternatively, create a new type checker with NewChecker
and invoke it incrementally by calling Checker.Files.

Type-checking consists of several interdependent phases:

Name resolution maps each identifier (ast.Ident) in the program to the
language object (Object) it denotes.
Use Info.{Defs,Uses,Implicits} for the results of name resolution.

Constant folding computes the exact constant value (constant.Value)
for every expression (ast.Expr) that is a compile-time constant.
Use Info.Types[expr].Value for the results of constant folding.

Type inference computes the type (Type) of every expression (ast.Expr)
and checks for compliance with the language specification.
Use Info.Types[expr].Type for the results of type inference.

For a tutorial, see




Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.


Functions, Macros, and Special Forms