rogpeppe / go-internal

Selected Go-internal packages factored out from the standard library
BSD 3-Clause "New" or "Revised" License
839 stars 69 forks source link

Allow reading from stdin in perpetuity #112

Open mpvl opened 3 years ago

mpvl commented 3 years ago

It can be useful to test how programs behave reading from stdin if this is not terminated. Currently this doesn't seem possible. Either stdin sends EOF immediately or it must be set with finite content.

mvdan commented 3 years ago

I would also find this useful for testing edge cases. We could add stdin - to mean that stdin is left open forever but never provies any bytes.

rogpeppe commented 3 years ago

Can you provide an example testscript where this might come in useful? I'm finding it hard to understand how this would work in practice.