Not very, but it does depend on the details. For example, you might provide
your own http.Transport for the client to use, or even your own net.Conn.
You might have the server stop sending any data, so eventually the
connection will timeout.

The question is, though, why would you want that? Is that actually a path
that is worth testing? Personally, I kind of doubt it. You'll probably get
more bang for your buck, if you instead send back broken/incomplete data
from the server and see if the client handles that correctly.

On Tue, Feb 13, 2018 at 5:01 PM, Patrik Iselind <patrik....@gmail.com>
wrote:

> What can go wrong if i try to use ioutil.ReadAll() on a HTTP response?
> Isn't that very hard to fake?
>
> --
> 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.
>

-- 
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