If you need to convert a string
to an int
in Go, then you should use the strconv.Atoi
function:
package main
import (
"strconv"
"fmt"
)
func main() {
t := strconv.Atoi("123")
fmt.Println(t)
}
If you need to convert a string
to an int
in Go, then you should use the strconv.Atoi
function:
package main
import (
"strconv"
"fmt"
)
func main() {
t := strconv.Atoi("123")
fmt.Println(t)
}