Automatically Converts char type to integer type

var s = ‘a’
fmt.Printf("%T is type of s\n",s)
fmt.Println(s)

Output:
int32 type of s
97

This is as documented in the specs:

rune        alias for int32
1 Like

Thank You Sir For letting me know.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.