I have encountered a situation that I do not understand.
a := "hello"
fmt.Printf("%v %T\n",a[0],a[0])
This gives 104 uint8
.
for _,v := range a {
fmt.Printf("%v %T\n",v,v)
}
This gives 104 int32
for the first iteration. I don't understand why their types are not same. First one is byte
, second one is rune
. I expect both to be byte
.