Original post

How does one create a modified copy of a slice (ie, separate underlying array) while iterating through said slice? I understand that using this append function a la https://play.golang.org/p/pJa4mhbfwM7 won’t work, but I can’t figure out what idiom will work. I feel like I’ve tried every invocation of copy and append possible.

submitted by /u/monkeyfacebag
[link] [comments]