When I index a Go string at position n, why don’t I get the nth character?

True life story
a := “documents”
fmt.Println(a[3])
> 117In Go, a string is in effect a read-only slice of bytes. As we saw, indexing a string yields its bytes, not its characters: a string is just a bunch of bytes. That means that when we store a character value in a string it is exactly equivalent to a slice of bytes..
The concept of character in computing is therefore ambiguous, or at least confusing, so we use it with care. To make things dependable, there are normalization techniques that guarantee that a given character is always represented by the same code points (ID, byte).
“Code point” is a bit of a mouthful, so Go introduces a shorter term for the concept: rune. The term appears in the libraries and source code, and means exactly the same as “code point”, with one interesting addition.
The Go language defines the word rune as an alias for the type int32, so programs can be clear when an integer value represents a code point. Moreover, what you might think of as a character constant is called a rune constant in Go. The type and value of the expression
To answer the question posed at the beginning: Strings are built from bytes so indexing them yields bytes, not characters.
