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
+10.7k Golang : Simple File Server
+15.3k Golang : Delete certain files in a directory
+6.6k Golang : Warp text string by number of characters or runes example
+6.9k Get Facebook friends working in same company
+33.7k Golang : All update packages with go get command
+5.4k Python : Delay with time.sleep() function example
+8.1k Golang : Get all countries phone codes
+12.2k Golang : Detect user location with HTML5 geo-location
+10.6k Golang : Select region of interest with mouse click and crop from image
+17.5k Golang : Linked list example
+19.4k Golang : Get host name or domain name from IP address
+39.1k Golang : How to iterate over a []string(array)