On Mon, Jun 27, 2016 at 12:26 AM Peter Kleiweg <pklei...@xs4all.nl> wrote:

> I don't know what I expected, but it's weird. Don't mess with slices.

Well, working as expected, considering slice backing array is possibly
shared wrt the result of append. (Or other slice op, b/c slices _are_
values.)

However, it's easy to avoid the append sharing when/where not desirable:
https://play.golang.org/p/oIFHamYWB-


-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to