[]byte("string")
created in for loops are "persisted" on iteration
#1570
Milestone
[]byte("string")
created in for loops are "persisted" on iteration
#1570
Another issue pertaining to byte slices generated as a result of converting from a string. See-also: #1569, and #1135 for a possibly related bug about for loop retaining the same block on iteration.
The output should be:
as
l
is modified only in the first iteration.This does not happen if the byte slice is "explicitly" initialized from its bytes:
Workaround: use
append
to initialize a new byte slice.The text was updated successfully, but these errors were encountered: