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

The correct go way to do this is to use conditional compilation and hide your platform specific optimizations in a lib_{linux,darwin,...}.go file with the slower default in a file that only gets compiled if the other files don't.

And indeed this is how the stdlib does it. If the rest of the go community is not adopting this practice then they aren't following good Idioms in their Go code.



And I totally would have agreed with the author of this article if the tl;dr of the article was just the first sentence you wrote.

Unfortunately, sanity did not prevail today.




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

Search: