Re: [go-nuts] Append to slice... what happens?

2016-07-01 Thread Ian Lance Taylor
On Fri, Jul 1, 2016 at 2:42 AM, Martin Geisler wrote: > > On Mon, Jun 27, 2016 at 8:18 PM, Ian Lance Taylor wrote: >> On Sun, Jun 26, 2016 at 10:55 PM, Dan Kortschak >> wrote: >>> On Mon, 2016-06-27 at 07:49 +0200, Martin

Re: [go-nuts] Append to slice... what happens?

2016-07-01 Thread Martin Geisler
Hi Ian, On Mon, Jun 27, 2016 at 8:18 PM, Ian Lance Taylor wrote: > On Sun, Jun 26, 2016 at 10:55 PM, Dan Kortschak > wrote: >> On Mon, 2016-06-27 at 07:49 +0200, Martin Geisler wrote: >>> BTW, I was about to say that you could simplify the line

Re: [go-nuts] Append to slice... what happens?

2016-06-26 Thread Martin Geisler
Hi Henry, On Mon, Jun 27, 2016 at 3:55 AM, Henry wrote: > If you were to change the code a bit as follows > https://play.golang.org/p/VwtWRQBrEe , it will work as you expect. > > I think it is probably safer to instantiate a slice without specifying the > initial

Re: [go-nuts] Append to slice... what happens?

2016-06-26 Thread Henry
If you were to change the code a bit as follows https://play.golang.org/p/VwtWRQBrEe , it will work as you expect. I think it is probably safer to instantiate a slice without specifying the initial capacity. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Append to slice... what happens?

2016-06-26 Thread Jan Mercl
On Mon, Jun 27, 2016 at 12:26 AM Peter Kleiweg 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.)

[go-nuts] Append to slice... what happens?

2016-06-26 Thread Peter Kleiweg
This: https://play.golang.org/p/AE670rTMpE I don't know what I expected, but it's weird. Don't mess with slices. -- 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