code: func (c *conn) receiveFrame(observeDeadline bool) (*messageEvent, error) {
  	var deadlineChan <-chan time.Time // Receiving on a nil channel always blocks indefinitely
  
  	if observeDeadline && !c.readDeadline.IsZero() {
  		now := time.Now()
  		if now.After(c.readDeadline) {
  			select {
  			case item, ok := <-c.ch:
  				return c.handleFrame(item, ok)
  			default:
  				return nil, errDeadlineReached
  			}
  		}
  
  		timer := time.NewTimer(c.readDeadline.Sub(now))
  		defer timer.Stop()
  
  		deadlineChan = timer.C
  	}
  
  	select {
  	case item, ok := <-c.ch:
  		return c.handleFrame(item, ok)
  	case <-deadlineChan:
  		return nil, errDeadlineReached
  	}
  }
docs: // receiveFrame receives one full frame from the WebSocket. It blocks until the
  // frame is received.