hello every body i was thinking about if i want index one number in golang how can i do it for example i have a var with name num that equal 123 and i want say pick first number in this variable and give me 1 and i say oh i can make it to string and then index and after that becomes my index to number
package main
import (
"fmt"
)
func main() {
num := 123
z := string(num)[0]
x := int(z)
fmt.Println(x)
}
i expect to see number 1 but i dont know how to without use “for” or any thing becomes my number to index