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
+5.4k Golang : If else example and common mistake
+6.3k PHP : Proper way to get UTF-8 character or string length
+15.6k Golang : Convert date format and separator yyyy-mm-dd to dd-mm-yyyy
+24.4k Golang : How to validate URL the right way
+8.5k Golang : Another camera capture GUI application with GTK and OpenCV
+24k Golang : Find biggest/largest number in array
+14.1k Golang : Chunk split or divide a string into smaller chunk example
+12.9k Golang : Get terminal width and height example
+6.7k Golang : Find the longest line of text example
+13.5k Golang : reCAPTCHA example
+13.7k Generate salted password with OpenSSL example
+10.4k Swift : Convert (cast) String to Integer