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
+8.6k Golang : Find duplicate files with filepath.Walk
+5.2k Golang : Pad file extension automagically
+7.4k Golang : How to stop user from directly running an executable file?
+10.5k Golang : Simple File Server
+30.2k Golang : Generate random string
+10k Golang : Find and replace data in all files recursively
+16.3k Golang : Execute terminal command to remote machine example
+12.1k Golang : List running EC2 instances and descriptions
+20.6k Golang : Underscore or snake_case to camel case example
+6.5k Golang : How to validate ISBN?
+8k Golang : Randomize letters from a string example