News for hackers. Stuff that matters.
Re:Things I Love About Go by densh on Friday June 22, 2012 @05:42PM (#4148971)
IMO The right way is to have a slice filled with pointers rather than bare structs: https://gist.github.com/2975397

Btw code that uses range will always be faster than alternative with for loop and indexing (obj[i]) as range-based code can be optimized by Go compiler not to perform any bound checks.

Re:Things I Love About Go by jbert on Friday June 22, 2012 @05:49PM (#4149002)
Yes, that works nicely, thanks. But sometimes (rarely) you do want a contiguous bunch of objects, rather than have the indirection.

I think ideally, it would work (as an alias) but if not, I think it should error. Or maybe this is a FAQ, with a good rationale, which I just haven't got to yet.

Re:Things I Love About Go by drivebyacct2 on Friday June 22, 2012 @07:39PM (#4149472)
I've been burnt by it as well, I didn't read the spec closely enough apparently. I would love to see it called out in an example.