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
+30.9k Golang : Convert []string to []byte examples
+10.6k Golang : Handle API query by curl with Gorilla Queries example
+10.3k Golang : GTK Input dialog box examples
+16.2k Golang : Parse date string and convert to dd-mm-yyyy format
+4.3k Golang : How to deal with configuration data?
+15.3k Golang : Send email and SMTP configuration example
+4.1k Linux/Unix/MacOSX : Find out which application is listening to port 80 or use which IP version
+25.9k PHP : Count number of JSON items/objects
+8.9k Golang : Simple Jawi(Yawi) to Rumi(Latin/Romanize) converter
+11.1k Golang : Get month name from date example
+5.6k Golang : How to setup a disk space used monitoring service with Telegram bot
+11.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example