Convert uint32 to int in Go
The Go Programming Language Specification
Conversions
Conversions are expressions of the form
T(x)
whereT
is a type andx
is an expression that can be converted to typeT
.
For example,
size := binary.BigEndian.Uint32(b[4:])
n, err := rdr.Discard(int(size))
Simply Use the int()
cast function