On Fri, Mar 16, 2018 at 5:29 AM, Alex Efros <power...@powerman.name> wrote:
>
> On Thu, Mar 15, 2018 at 12:49:15PM +0000, roger peppe wrote:
>> If it helps, you can set deadlines on *os.File now, as of Go 1.10:
>>
>>    https://play.golang.org/p/h3Pg9Ql0CMB
>>
>> I don't see a way to cancel without deciding the deadline in advance though.
>
> Why? What makes os.Stdin so special?
>
> If we add this at beginning of main() it'll work as expected:
>     os.Stdin, _ = os.Open("/dev/stdin")

What is special about os.Stdin is the way it is initialized, which is
to say it is normally in blocking mode, and therefore reads block even
if you close the descriptor in a different goroutine.  This would be
affected by changes to https://golang.org/issue/22939.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to