4 ms·
> The biggest problem is any string you pass as an argument to the fmt functions is moved onto the heap FWIW, that's not quite correct. For example, a string l
by typical182 1y ago
> The biggest problem is any string you pass as an argument to the fmt functions is moved onto the heap
FWIW, that's not quite correct. For example, a string literal passed as a fmt argument won't be moved to the heap.
The upcoming Go 1.25 release has some related improvements that help strings in more cases. See for example https://go.dev/cl/649079 https://go.dev/cl/649079.
- fsmv 1y agoYeah I just saw in the bug they're finally making progress on fixing this, exciting! I edited in the link if you didn't see.