select(2) implementation in Go