func LXDProfileNames(names []string) []string {
	// ensure that the ones we have are unique
	unique := make(map[string]int)
	for k, v := range names {
		if !IsValidName(v) {
			continue
		}
		unique[v] = k
	}
	i := 0
	unordered := make([]nameIndex, len(unique))
	for k, v := range unique {
		unordered[i] = nameIndex{
			Name:  k,
			Index: v,
		}
		i++
	}
	sort.Slice(unordered, func(i, j int) bool {
		return unordered[i].Index < unordered[j].Index
	})
	ordered := make([]string, len(unordered))
	for k, v := range unordered {
		ordered[k] = v.Name
	}
	return ordered
}
// LXDProfileNames ensures that the LXD profile names are unique yet preserve
// the same order as the input. It removes certain profile names from the list,
// for example "default" profile name will be removed.
LXDProfileNames ensures that the LXD profile names are unique yet preserve
the same order as the input. It removes certain profile names from the list,
for example "default" profile name will be removed.
// LXDProfileNames ensures that the LXD profile names are unique yet preserve // the same order as the input . It removes certain profile names from the list // for example " default " profile name will be removed .
func LXDProfileNames(names []string) []string {
	unique := make(map[string]int)
	for k, v := range names {
		if !IsValidName(v) {
			continue
		}
		unique[v] = k
	}
	i := 0
	unordered := make([]nameIndex, len(unique))
	for k, v := range unique {
		unordered[i] = nameIndex{
			Name:  k,
			Index: v,
		}
		i++
	}
	sort.Slice(unordered, func(i, j int) bool {
		return unordered[i].Index < unordered[j].Index
	})
	ordered := make([]string, len(unordered))
	for k, v := range unordered {
		ordered[k] = v.Name
	}
	return ordered
}
func LXDProfileNames ( names [ ] string ) [ ] string { unique := make ( map [ string ] int ) for k , v := range names { if ! IsValidName ( v ) { continue } unique [ v ] = k } i := 0 unordered := make ( [ ] nameIndex , len ( unique ) ) for k , v := range unique { unordered [ i ] = nameIndex { Name : k , Index : v , } i ++ } sort . Slice ( unordered , func ( i , j int ) bool { return unordered [ i ] . Index < unordered [ j ] . Index } ) ordered := make ( [ ] string , len ( unordered ) ) for k , v := range unordered { ordered [ k ] = v . Name } return ordered }
LXDProfileNames ensures that the LXD profile names are unique yet preserve
the same order as the input.
LXDProfileNames ensures that the LXD profile names are unique yet preserve the same order as the input .
// ensure that the ones we have are unique