code: func (c *Connection) allocateChannel() (*Channel, error) {
  	c.m.Lock()
  	defer c.m.Unlock()
  
  	if c.IsClosed() {
  		return nil, ErrClosed
  	}
  
  	id, ok := c.allocator.next()
  	if !ok {
  		return nil, ErrChannelMax
  	}
  
  	ch := newChannel(c, uint16(id))
  	c.channels[uint16(id)] = ch
  
  	return ch, nil
  }
docs: // allocateChannel records but does not open a new channel with a unique id.
  // This method is the initial part of the channel lifecycle and paired with
  // releaseChannel