ab8968437b
Instead of special-casing anonymous endpoints in libnetwork, let the daemon specify what (non fully qualified) DNS names should be associated to container's endpoints. Signed-off-by: Albin Kerouanton <albinker@gmail.com>
13 lines
249 B
Go
13 lines
249 B
Go
package sliceutil
|
|
|
|
func Dedup[T comparable](slice []T) []T {
|
|
keys := make(map[T]struct{})
|
|
out := make([]T, 0, len(slice))
|
|
for _, s := range slice {
|
|
if _, ok := keys[s]; !ok {
|
|
out = append(out, s)
|
|
keys[s] = struct{}{}
|
|
}
|
|
}
|
|
return out
|
|
}
|