There are many other symbols invented by humans other than the ‘abcde..’ symbols. And there are so many that we need 32 bit to encode them.
A rune is a builtin type in Go and it’s the alias of int32
. rune represents a Unicode CodePoint in Go. It does not matter how many bytes the code point occupies, it can be represented by a rune. For example the rule literal a
is in reality the number 97.
A string is not necessarily a sequence of runes. We can convert between string
and []rune
, but they are different.