Tad,
Go has two distinct number representation, conversion, and arithmetic
systems: one system for constants, which is used by the compiler, and
one system for variables, which is used at run time. Numeric constants
represent values of arbitrary precision and do not overflow. Constants
may be typed or untyped. Numeric variables (integer, floating point,
and complex) represent values of fixed precision and can overflow.
Variables are typed. Numeric variables follow the IEEE 754 standard,
constants do not.
var x = -3
var y uint32 = uint32(x)
The variable x is of type int. When converting between non-constant
integer types, if the value is a signed integer, it is sign extended
to implicit infinite precision; otherwise it is zero extended. It is
then truncated to fit in the result type's size. The conversion always
yields a valid value; there is no indication of overflow. Therefore,
uint32(x) is a valid variable conversion.
// constant -3 overflows uint32
var y uint32 = uint32(int(-3))
As the compiler explains, int(-3) is a constant of type int.
Therefore, uint32(int(-3)) is not a valid constant conversion, it
overflows.
The Go Programming Language Specification
http://golang.org/ref/spec
Peter