If you need to convert an int
to a string
in Go, then you should use the strconv.Itoa
function:
1
2
3
4
5
6
7
8
9
|
package main
import (
"strconv"
"fmt"
)
func main() {
t := strconv.Itoa(123)
fmt.Println(t)
}
|
Learn how to convert a string value to an int in Go.