package/ to help with testing of "Read()" failures...?

58 views
Skip to first unread message

Eric Johnson

unread,
May 22, 2017, 2:37:44 PM5/22/17
to golang-nuts
Looks like iotest package provides tools to simulate various weird read behaviors.

However, I want to simulate a failure, instead of just a slowdown or a change in whether the EOF error is returned after the last full read. Something like "ReadFailAfterN" which will trigger a non-EOF error after N bytes read....

Googling for various combinations of keywords hasn't gotten me very far, because "fail" and "error" come up too commonly.

Anything out there?

Eric.

Dragos Harabor

unread,
May 22, 2017, 10:58:36 PM5/22/17
to golang-nuts
Not sure whether this is for network tests, this package might help you, at least as inspiration/starting point:
Reply all
Reply to author
Forward
0 new messages