Strings, bytes, runes and characters in Go - The Go Programming Language
Strings, bytes, runes and characters in Go - The Go Programming Language
11
Public whispers
7
Contributors
2026-07-25 10:01:10
First whispered
Discussion activity
Public whispers on go.dev over the last 17 weeks
LessMore
Recent public whispers
Text Highlight2026-07-26 16:25:15
Original Highlight Excerpt
"Even though the slice header is passed by value"
Whisper Note
This is exactly why slices feel like references even though they're not.
Text Highlight2026-07-26 13:22:15
Original Highlight Excerpt
"s important to understand that even though a slice contains a pointer"
Whisper Note
So it's like a struct with a pointer inside? That actually clears things up.
Text Highlight2026-07-26 13:13:15
Original Highlight Excerpt
"s important to understand that even though a slice contains a pointer"
Whisper Note
Yeah, took me a while to get that slices are values, not just pointers.
Text Highlight2026-07-26 10:19:15
Original Highlight Excerpt
"A slice is not an array."
Whisper Note
Yeah, but honestly the distinction only bites you when you mess with append too much.
Text Highlight2026-07-26 10:10:15
Original Highlight Excerpt
"A slice is not an array."
Whisper Note
Always forget this—then I wonder why changing a slice changes the original array.
Text Highlight2026-07-26 10:01:15
Original Highlight Excerpt
"A slice is not an array."
Whisper Note
Wait, so a slice is like a view into an array, not the array itself? Mind blown.
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.
Ranked nearby
See what people are saying on go.dev
Install DomWhisper to view live whispers as you browse, and join the discussion.
Get the extension