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
+31.2k Golang : Example for ECDSA(Elliptic Curve Digital Signature Algorithm) package functions
+10.9k Golang : Intercept and process UNIX signals example
+34.7k Golang : Upload and download file to/from AWS S3
+5.6k Golang : Markov chains to predict probability of next state example
+6.6k Golang : Get expvar(export variables) to work with multiplexer
+7k Golang : Check if one string(rune) is permutation of another string(rune)
+13.4k Golang : Tutorial on loading GOB and PEM files
+16.7k Golang : Capture stdout of a child process and act according to the result
+4.7k Golang : PGX CopyFrom to insert rows into Postgres database
+5.3k Clean up Visual Studio For Mac installation failed disk full problem
+8.1k Golang : Count leading or ending zeros(any item of interest) example
+6.6k Swift : substringWithRange() function example