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
+13k Golang : Get HTTP protocol version example
+12.1k Golang : Check if an integer is negative or positive
+31.5k Golang : Create x509 certificate, private and public keys
+4.8k Golang : How to verify input is rune?
+15k Golang : Gzip file example
+6.5k Golang : Error reading timestamp with GORM or SQL driver
+10.7k Golang : 2 dimensional array example
+17k Golang : How to get own program name during runtime ?
+6.1k Golang : Check to see if *File is a file or directory
+7.5k Golang : Find duplicate files with filepath.Walk
+4.7k Linux/MacOSX : Search for files by filename and extension with find command