Int32 is used to represents 32-bit signed integers . Int64 is used to represents 64-bit signed integers.
Int64 is an immutable value type that represents signed integers with values that range from negative 9,223,372,036,854,775,808 (which is represented by the Int64. MinValue constant) through positive 9,223,372,036,854,775,807 (which is represented by the Int64.
This is called type conversion :
i := 23
var i64 int64
i64 = int64(i)
This is probably obvious, but simplest:
i64 := int64(23)
i := 23
i64 := int64(i)
fmt.Printf("%T %T", i, i64) // to print the data types of i and i64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With