mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update compose-go to v2.0.0-rc.8
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
15
vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go
generated
vendored
15
vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go
generated
vendored
@ -51,3 +51,18 @@ func ArrayContains[T comparable](source []T, toCheck []T) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func RemoveDuplicates[T comparable](slice []T) []T {
|
||||
// Create a map to store unique elements
|
||||
seen := make(map[T]bool)
|
||||
result := []T{}
|
||||
|
||||
// Loop through the slice, adding elements to the map if they haven't been seen before
|
||||
for _, val := range slice {
|
||||
if _, ok := seen[val]; !ok {
|
||||
seen[val] = true
|
||||
result = append(result, val)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
Reference in New Issue
Block a user