Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change int into int64?

Tags:

go

People also ask

What is the difference between Int32 and Int64?

Int32 is used to represents 32-bit signed integers . Int64 is used to represents 64-bit signed integers.

What is Int64?

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