How to change int in int64?

Im trying to convert an integer to an integer 64 in go, but they are out of luck. Does anyone know an easy way to do this?

+69
go
Oct 30 '12 at 10:47
source share
3 answers

This is called a type conversion :

i := 23 var i64 int64 i64 = int64(i) 
+114
Oct 30 '12 at 10:51
source share

This is probably obvious, but the simplest:

 i64 := int64(23) 
+6
Nov 18 '16 at 12:54 on
source share
 i := 23 i64 := int64(i) fmt.Printf("%T %T", i, i64) // to print the data types of i and i64 
+1
Aug 18 '15 at 3:58
source share



All Articles