go string to int strconv package
strconv is mainly used for the conversion of strings and basic types of data types
s := "aa"+100
int to string type
s := strconv.Itoa(23)
int64 to string type
s := strconv.FormatInt(int64, 10)
string to int type
i, err := strconv.Atoi(s)
string to int64 type
s1 := "10000"
b, err := strconv.ParseInt(s1, 10, 64)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%T,%d", b, b)
string to bool type
s1 := "true"
b, err := strconv.ParseBool(s1)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%T,%t", b, b)