mdlayher / vsock

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.
MIT License
328 stars 65 forks source link

Return net.ErrClosed instead of errors.New("use of closed network connection") #50

Open dimalinux opened 2 years ago

dimalinux commented 2 years ago

Right now when the library returns "closed" errors (which many users need to test against), it is not returning net.ErrClosed like the standard net libraries since Go 1.16. Instead of returning a local error that requires us to inspect the message text, can you return net.ErrClosed instead? It won't break existing code that checks the message, as the message inside of net.ErrClosed is identical. On the plus side, it will make the vsock library more compatible with code that was written to the built-in net library APIs. Thanks!