[go-nuts] Re: Calculation of the combinations between an unlimited number of slices

2017-12-08 Thread howardcshaw
When you use append, two different things can happen: 1. There is enough capacity in the original slice to which you are appending to add the additional values. You get a slice that points to the same backing memory. 2. There is not enough capacity in the original slice to which you are

[go-nuts] Re: Calculation of the combinations between an unlimited number of slices

2017-12-07 Thread Fred
Thanks @Jake Le jeudi 7 décembre 2017 01:01:46 UTC+1, Jake Montgomery a écrit : > > On Monday, December 4, 2017 at 2:56:19 PM UTC-5, Fred wrote: >> >> >> > Perhaps start with Go Slices: usage and internals > , for a more > complete

[go-nuts] Re: Calculation of the combinations between an unlimited number of slices

2017-12-04 Thread Fred
it seems that making a copy of the temp var, replacing : temp = append(temp, c1) by : temp = append(temp, append([]int{}, c1...)) helps, but still unclear for me why the problem was only visible on slice 4... -- You received this message because you are subscribed to the Google Groups