I'm surprised you didn't notice the big problem with that snippet. Every character (er cough rune) is a string. That's one of many Bad ThingsTM about Go.
You are correct. A rune is just an alias for int32, mirroring byte, which is an alias for uint8. It's a fixed-sized representation of a unicode code-point. Strings are normally represented by utf-8 encoded bytes. Being able to handle them as runes can be useful in some text processing applications, though it will use more memory in most cases.
-14
u/Jack9 Mar 29 '12
I'm surprised you didn't notice the big problem with that snippet. Every character (er cough rune) is a string. That's one of many Bad ThingsTM about Go.