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
+5.3k Golang : Issue HTTP commands to server and port example
+7.4k Golang : Of hash table and hash map
+5.7k Fix fatal error: evacuation not done in time problem
+4.1k Detect if Google Analytics and Developer Media are loaded properly or not
+21.9k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+11.3k CodeIgniter : How to check if a session exist in PHP?
+28.8k Golang : Read, Write(Create) and Delete Cookie example
+26.1k Golang : How to read integer value from standard input ?
+8.2k Golang : HTTP Server Example
+27k Golang : Find files by extension
+10.5k Golang : cannot assign type int to value (type uint8) in range error
+9.1k Golang : How to use Gorilla webtoolkit context package properly