code: func CloseNotifyConn(conn net.Conn) net.Conn {
  	pr, pw := io.Pipe()
  
  	c := &closeNotifyConn{
  		Conn: conn,
  		r:    pr,
  		cnc:  make(chan bool),
  	}
  
  	go func() {
  		_, err := io.Copy(pw, conn)
  		if err == nil {
  			err = io.EOF
  		}
  		pw.CloseWithError(err)
  		close(c.cnc)
  	}()
  
  	return c
  }
docs: // CloseNotifyConn returns a net.Conn that implements http.CloseNotifier.
  // Used to detect connections closed early on the client side.