News for hackers. Stuff that matters.
Re:Channels in Golang by frou_dh on Sunday December 25, 2016 @12:19PM (#13254727)
> Inside appendf we might have to do something gross, like duplicate the entire object, and append to the copy.

That's why you have to care about the return value in normal Go. The slice x opaquely references a backing array with a certain max capacity. If you append one too many times then it's going to return a completely new value that references a new backing array that has more legroom ... with all your existing elements copied into it.

(p.s. I just noticed that Go actually considers that "Probably Not" case a compile-time error)

There are no comments on this comment yet.