Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a side note the solution to the Discard problem is quite beautiful.

https://code.google.com/p/go/source/detail?r=4b61f121966b

As I read it makes a quick-try to acquire a pre-allocated buffer, otherwise makes its own. Then it makes a quick-try to give the buffer it used back (to be used by another goroutine).

That is a very elegant use of channels to create an optimistic buffer. Enjoyed that read :)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: