Go 1.16 has introducednet.ErrClosed
, which should be returned/wrapped when an I/O call is performed on a network connection which has already been closed. This is useful to avoid cluttering logs with messages likefailed to close WebSocket: already wrote close
.