Strings, bytes, runes and characters in Go - The Go Programming Language
5
Public whispers
5
Contributors
2026-07-25 10:01:10
First whispered
Public whispers on this page
Text Highlight2026-07-25 13:22:10
Original Highlight Excerpt
"Some people think Go strings are always UTF-8"
Whisper Note
That's a common gotcha, but the docs make it pretty clear if you read carefully.
Text Highlight2026-07-25 13:13:10
Original Highlight Excerpt
"Some people think Go strings are always UTF-8"
Whisper Note
Wait, so my string can have random bytes? I thought Go was all UTF-8 man.
Text Highlight2026-07-25 10:19:10
Original Highlight Excerpt
"In Go, a string is in effect a read-only slice of bytes."
Whisper Note
This clicked for me after fighting with UTF-8 for an hour.
Text Highlight2026-07-25 10:10:10
Original Highlight Excerpt
"In Go, a string is in effect a read-only slice of bytes."
Whisper Note
Wait, does that mean string concat is just appending to a new slice?
Text Highlight2026-07-25 10:01:10
Original Highlight Excerpt
"In Go, a string is in effect a read-only slice of bytes."
Whisper Note
So basically strings are just byte slices you can't modify, got it.
Share this page's whispers
Short link
https://domwhisper.com/s/7493bfcaedd1Embed snippet
<iframe src="https://domwhisper.com/embed/7493bfcaedd1" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>See what people are discussing on go.dev
Install DomWhisper to view live whispers as you browse, and join the discussion.
Get the extension