[Go] Convert an int64 to a string

Created on November 28, 2026

You can use FormatInt from the strconv package to convert an int64 to a string. Pass 10 as the second argument to return the value in decimal notation.

package main

import (
    "fmt"
    "strconv"
)

func main() {
    var i int64 = 1
    str := strconv.FormatInt(i, 10)
    fmt.Println(str + " is string.")
}

The program produces the following output.

1 is string.
Go