code: func (q *BytesQueue) Push(data []byte) (int, error) {
  	dataLen := len(data)
  
  	if q.availableSpaceAfterTail() < dataLen+headerEntrySize {
  		if q.availableSpaceBeforeHead() >= dataLen+headerEntrySize {
  			q.tail = leftMarginIndex
  		} else if q.capacity+headerEntrySize+dataLen >= q.maxCapacity && q.maxCapacity > 0 {
  			return -1, &queueError{"Full queue. Maximum size limit reached."}
  		} else {
  			q.allocateAdditionalMemory(dataLen + headerEntrySize)
  		}
  	}
  
  	index := q.tail
  
  	q.push(data, dataLen)
  
  	return index, nil
  }
docs: // Push copies entry at the end of queue and moves tail pointer. Allocates more space if needed.
  // Returns index for pushed data or error if maximum size queue limit is reached.