xxxxxxxxxx
s := strconv.Itoa(i)
// also
s := strconv.FormatInt(i, 10)
// and also
s := fmt.Sprintf("%d", i)
xxxxxxxxxx
package main
import (
"strconv"
"fmt"
)
func main() {
t := strconv.Itoa(123)
fmt.Println(t)
}
xxxxxxxxxx
package main
import (
"fmt"
"strconv"
)
func main() {
i := 10
s1 := strconv.FormatInt(int64(i), 10)
s2 := strconv.Itoa(i)
fmt.Printf("%v, %v\n", s1, s2)
}
xxxxxxxxxx
package main
import (
"fmt"
"strconv"
)
func main() {
// Convert an integer to a string
num := 42
str := strconv.Itoa(num)
fmt.Println(str)
}