code: func getFirstAvailableLun(exportList exportList) (int32, error) {
  	sort.Sort(exportList)
  	log.Debug("sorted export List: ", exportList)
  	//this is sloppy way to remove duplicates
  	uniqueExport := make(map[int32]export)
  	for _, export := range exportList {
  		uniqueExport[export.Lun] = export
  	}
  	log.Debug("unique luns sorted export List: ", uniqueExport)
  
  	//this is a sloppy way to get the list of luns
  	luns := make([]int, len(uniqueExport), len(uniqueExport))
  	i := 0
  	for _, export := range uniqueExport {
  		luns[i] = int(export.Lun)
  		i++
  	}
  	log.Debug("lun list: ", luns)
  
  	if len(luns) >= 255 {
  		return -1, errors.New("255 luns allocated no more luns available")
  	}
  
  	var sluns sort.IntSlice
  	sluns = luns[0:]
  	sort.Sort(sluns)
  	log.Debug("sorted lun list: ", sluns)
  
  	lun := int32(len(sluns))
  	for i, clun := range sluns {
  		if i < int(clun) {
  			lun = int32(i)
  			break
  		}
  	}
  	return lun, nil
  }
docs: // getFirstAvailableLun gets first available Lun.