Hacker News new | past | comments | ask | show | jobs | submit login

You can select on the read and an time.After channel which "interrupts" the select for a timeout.



You can't select on a read, though. select{} only works on channels. You can run the read in a separate goroutine, but that doesn't stop the read from happening.


You can't use the language "select", but you can call the select(2) system call.


Indeed, someone already pointed this out: https://news.ycombinator.com/item?id=13332847.




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

Search: