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
+11.7k Golang : Skip blank/empty lines in CSV file and trim whitespaces example
+32.2k Golang : Create x509 certificate, private and public keys
+27.8k Golang : How to create new XML file ?
+5k Linux/MacOSX : Search for files by filename and extension with find command
+10.3k Golang : Fuzzy string search or approximate string matching example
+4.5k Golang : Display advertisement images or strings on random order
+7.5k Golang : Another camera capture GUI application with GTK and OpenCV
+5k Golang : How to write backslash in string?
+18.2k Golang : How to Set or Add Header http.ResponseWriter?
+9.3k Golang : Meaning of omitempty in struct's field tag
+4.3k Responsive Google Adsense
+7.9k Golang : Get SPF and DMARC from email headers to fight spam