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
+8.7k Golang : Inject/embed Javascript before sending out to browser example
+7.9k Golang : HttpRouter multiplexer routing example
+9.7k Golang : Ordinal and Ordinalize a given number to the English ordinal numeral
+7.6k Golang : Regular Expression find string example
+11.5k Golang : Verify Linux user password again before executing a program example
+6.8k Golang : Find the shortest line of text example
+11.6k Golang : Convert(cast) bigint to string
+29k Golang : Save map/struct to JSON or XML file
+10.3k RPM : error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
+11.7k Golang : How to parse plain email text and process email header?
+5.2k Golang : If else example and common mistake
+8.2k Golang : Add text to image and get OpenCV's X, Y co-ordinates example