[Go] Convert an int to an int64

Created on November 30, 2026

Use int64(value) to explicitly convert a Go int to int64. An int is either 32 or 64 bits wide, so every int value fits in an int64.

package main

import "fmt"

func main() {
    count := 1
    total := int64(count)
    fmt.Printf("%d (%T)\n", total, total)
}
1 (int64)
Go