[go-nuts] Re: Why is src modified when concatenating slices with dst = append(dst, src[:i])

2016-11-20 Thread Bogdan Katyński
Thank you very much for the replies. I've read the blog about slices again and I'm pretty sure I know what is happening in my example and how are dst and src interconnected. I've started thinking how I can achieve what I'm looking for in the nicest way, and after some trial and error, I've come

[go-nuts] Why is src modified when concatenating slices with dst = append(dst, src[:i])

2016-11-19 Thread Bogdan Katyński
Hello Group, I'm very new to GoLang and this is my first post to the group so first of all hello all :) I just came across a strange thing which I'm failing to understand: https://play.golang.org/p/BOCsJqIw63 I don't understand why in Step2, the src slice is changed to [1 2 3 4 1 6 7 8] I su