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
+12.6k Golang : Compress and decompress file with compress/flate example
+4.5k Swift : Convert string array to array example
+20.6k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+25.1k Golang : Encrypt and decrypt data with AES crypto
+9.7k Golang : Create Temporary File
+10.1k Golang : Find age or leap age from date of birth example
+4.8k Linux : Disable and enable IPv4 forwarding
+5.7k Golang : Reverse by word
+7k Golang : Add build version and other information in executables
+10.9k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+35.1k Golang : Convert date or time stamp from string to time.Time type
+5.9k Golang : Levenshtein distance example