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
+88.6k Golang : How to convert character to ASCII and back
+5.6k Golang : Display advertisement images or strings on random order
+6.9k Golang : Humanize and Titleize functions
+9.5k Golang : Play .WAV file from command line
+11.3k Golang : How to determine a prime number?
+6.5k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+15.4k Golang : Get timezone offset from date or timestamp
+6.2k Java : Human readable password generator
+7.7k Golang : Set horizontal, vertical scroll bars policies and disable interaction on Qt image
+6.1k Golang : Experimenting with the Rejang script
+5.7k Swift : Get substring with rangeOfString() function example
+9.6k Golang : Accessing content anonymously with Tor