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
+14.3k Golang : Fix image: unknown format error
+12.9k Golang : Listen and Serve on sub domain example
+36.8k Golang : Display float in 2 decimal points and rounding up or down
+8.7k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+12.4k Golang : Get month name from date example
+4.4k Javascript : How to show different content with noscript?
+9.6k Golang : Convert(cast) string to int64
+23.8k Find and replace a character in a string in Go
+10.4k Golang : Convert file content to Hex
+19.6k Golang : How to Set or Add Header http.ResponseWriter?
+22.1k Golang : Use TLS version 1.2 and enforce server security configuration over client