code: func (handle *ContextHandle) findSlot(ctx *mPkcs11.Ctx) (uint, bool) {
  
  	var found bool
  	var slot uint
  
  	//get all slots
  	slots, err := ctx.GetSlotList(true)
  	if err != nil {
  		logger.Warn("Failed to get slot list for recreated context:", err)
  		return slot, found
  	}
  
  	//find slot matching label
  	for _, s := range slots {
  		info, err := ctx.GetTokenInfo(s)
  		if err != nil {
  			continue
  		}
  		logger.Debugf("Looking for %s, found label %s\n", handle.label, info.Label)
  		if handle.label == info.Label {
  			found = true
  			slot = s
  			break
  		}
  	}
  
  	return slot, found
  }
docs: //findSlot finds slot for given pkcs11 ctx and label