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.1k Golang : Issue HTTP commands to server and port example
+12.4k Golang : "https://" not allowed in import path
+11.6k How to tell if a binary(executable) file or web application is built with Golang?
+12.3k Golang : Extract part of string with regular expression
+8.9k Golang : automatically figure out array length(size) with three dots
+19.8k Golang : How to get time from unix nano example
+16.3k Golang :Trim white spaces from a string
+6.8k Golang : Normalize email to prevent multiple signups example
+17.2k Golang : How to tell if a file is compressed either gzip or zip ?
+8.2k Swift : Convert (cast) Character to Integer?
+10.2k Golang : Detect number of faces or vehicles in a photo
+14.5k Golang : Reset buffer example