code: func isErrClosing(err error) bool {
  	switch err2 := err.(type) {
  	case *net.OpError:
  		err = err2.Err
  	}
  	return err.Error() == "use of closed network connection"
  }
docs: // Closing the socket from another goroutine causes a concurrent
  // blocking read to return a net.errClosing error. It's pointless to
  // spam logs with it. The error is not exported, so checking for it is
  // ugly.
  //
  // Background: https://code.google.com/p/go/issues/detail?id=4373