- Typical constants
constkeyword can appear anywhere, maybe declaring a type
- Type given by explicit cast or use in context
// const declares a constant value.
const s string = “constant”
// A const statement can appear anywhere a var statement can.
const n = 500000000
// Constant expressions perform arithmetic with arbitrary precision.
const d = 3e20 / n
// A numeric constant has no type until it’s given one, such as by an explicit cast.
// A number can be given a type by using it in a context that requires one, such as a variable assignment or function call. For example, here math.Sin expects a float64.
constant 6e+11 600000000000 -0.28470407323754404