Go如何处理大于单个字节的字符?

In Go a byte is the same as an uint8. Which means a byte can store a value between 0 and 255.

A string can also be written as a slice of bytes. I've read that there are almost no differences between a string and a slice of bytes (except the mutability).

So how is it possible in Go to write something like "世界" when this is clearly not in the first 255 characters in the UTF-8 encoding table? How does Go handle characters that are not within the first 255 rows in the UTF8 encoding table?

Go uses UTF-8 encoding for source files, string literals, []rune to string conversions, string to []rune conversions, integer to string conversions and on range over string.

UTF-8 uses one to four bytes to encode a character.