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
+31.7k Golang : Get local IP and MAC address
+17k Golang : How to save log messages to file?
+4.8k PHP : Extract part of a string starting from the middle
+5.6k PHP : Convert CSV to JSON with YQL example
+13.5k Golang : Verify token from Google Authenticator App
+13.2k Golang : Skip blank/empty lines in CSV file and trim whitespaces example
+20.5k nginx: [emerg] unknown directive "passenger_enabled"
+11.3k CodeIgniter : How to check if a session exist in PHP?
+27.5k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+12.4k Golang : 2 dimensional array example
+4.7k Javascript : Access JSON data example