code: func (memif *Memif) initQueues() error {
  	// Get Rx/Tx queues count.
  	details, err := memif.GetDetails()
  	if err != nil {
  		return err
  	}
  
  	log.WithFields(logger.Fields{
  		"ifName":   memif.IfName,
  		"Rx-count": len(details.RxQueues),
  		"Tx-count": len(details.TxQueues),
  	}).Debug("Initializing Rx/Tx queues.")
  
  	// Initialize interrupt channels.
  	var i int
  	for i = 0; i < len(details.RxQueues); i++ {
  		queueIntCh := make(chan struct{}, 1)
  		memif.queueIntCh = append(memif.queueIntCh, queueIntCh)
  	}
  
  	// Initialize Rx/Tx packet buffers.
  	for i = 0; i < len(details.RxQueues); i++ {
  		memif.rxQueueBufs = append(memif.rxQueueBufs, CPacketBuffers{})
  		if !memif.IsMaster {
  			errCode := C.memif_refill_queue(memif.cHandle, C.uint16_t(i), C.uint16_t(memif.ringSize-1), 0)
  			err = getMemifError(int(errCode))
  			if err != nil {
  				log.Warn(err.Error())
  			}
  		}
  	}
  	for i = 0; i < len(details.TxQueues); i++ {
  		memif.txQueueBufs = append(memif.txQueueBufs, CPacketBuffers{})
  	}
  
  	return nil
  }
docs: // initQueues allocates resources associated with Rx/Tx queues.