code: func (nc *Conn) FlushTimeout(timeout time.Duration) (err error) {
  	if nc == nil {
  		return ErrInvalidConnection
  	}
  	if timeout <= 0 {
  		return ErrBadTimeout
  	}
  
  	nc.mu.Lock()
  	if nc.isClosed() {
  		nc.mu.Unlock()
  		return ErrConnectionClosed
  	}
  	t := globalTimerPool.Get(timeout)
  	defer globalTimerPool.Put(t)
  
  	// Create a buffered channel to prevent chan send to block
  	// in processPong() if this code here times out just when
  	// PONG was received.
  	ch := make(chan struct{}, 1)
  	nc.sendPing(ch)
  	nc.mu.Unlock()
  
  	select {
  	case _, ok := <-ch:
  		if !ok {
  			err = ErrConnectionClosed
  		} else {
  			close(ch)
  		}
  	case <-t.C:
  		err = ErrTimeout
  	}
  
  	if err != nil {
  		nc.removeFlushEntry(ch)
  	}
  	return
  }
docs: // FlushTimeout allows a Flush operation to have an associated timeout.