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
+1k Java : Get FX sentiment from website example
+17.3k Golang : GORM read from database example
+8.5k Golang : Underscore or snake_case to camel case example
+5.1k Golang : Resolve domain name to IP4 and IP6 addresses.
+7.1k Golang : Get timezone offset from date or timestamp
+7.9k CodeIgniter : How to check if a session exist in PHP?
+3.7k Android Studio : Indicate progression with ProgressBar example
+6.6k Swift : Convert (cast) Float to String
+10.2k Golang : Gzip file example
+11.3k Golang : Print leading(padding) zero or spaces in fmt.Printf?
+2.5k Golang : Populate slice with sequential integers example
+2.3k Unix/Linux/MacOSx : How to remove an environment variable ?