Description

A Const represents the value of a constant expression.

The underlying type of a constant may be any boolean, numeric, or string type. In addition, a Const may represent the nil value of any reference type---interface, map, channel, pointer, slice, or function---but not "untyped nil".

All source-level constant expressions are represented by a Const of the same type and value.

Value holds the exact value of the constant, independent of its Type(), using the same representation as package go/exact uses for constants, or nil for a typed nil value.

Pos() returns token.NoPos.

Example printed form:

42:int
"hello":untyped string
3+4i:MyComplex