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 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.