If you need to convert a string to an int in Go, then you should use the strconv.Atoi function:

1
2
3
4
5
6
7
8
9
package main
import (
    "strconv"
    "fmt"
)
func main() {
    t := strconv.Atoi("123")
    fmt.Println(t)
}

Learn how to convert an int value to a string in Go.