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
+9.4k Random number generation with crypto/rand in Go
+34.7k Golang : Upload and download file to/from AWS S3
+19.3k Golang : Close channel after ticker stopped example
+5.8k Fix ERROR 2003 (HY000): Can't connect to MySQL server on 'IP address' (111)
+4.6k Javascript : How to get width and height of a div?
+8.1k Golang: Prevent over writing file with md5 hash
+4.6k Fix Google Analytics Redundant Hostnames problem
+4.5k JavaScript: Add marker function on Google Map
+8.7k Golang : Sort lines of text example
+12k Golang : calculate elapsed run time
+31.9k Golang : Math pow(the power of x^y) example
+4.7k JQuery : Calling a function inside Jquery(document) block