Golang : Convert(cast) int to int64
It is not so cool to use type int now. It was so yesterday. Everyone wants to move to 64-bit computing now. This tutorial will show you how to convert / type cast int to int64
package main
import (
"fmt"
)
func main() {
var i int64 = 10
var int64value int64 = int64(i)
fmt.Println(int64value)
// or
fmt.Println(int64(int64value))
}
Output :
10
10
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+6.6k Gogland : Single File versus Go Application Run Configurations
+14.8k Golang : Delete files by extension
+7.7k Golang : Gorilla web tool kit schema example
+29.3k Golang : How to convert(cast) string to IP address?
+13.3k Golang : How to filter a map's elements for faster lookup
+10.5k Golang : Get remaining text such as id or filename after last segment in URL path
+11.7k Generate salted password with OpenSSL example
+9.2k Golang : How to profile or log time spend on execution?
+28k Golang : JQuery AJAX post data to server and send data back to client example
+12.6k Golang : How to determine if a year is leap year?
+8.4k Golang : Convert(cast) string to int64
+9.4k Golang : Select region of interest with mouse click and crop from image