MCPcopy
hub / github.com/docker/compose / NewSet

Function NewSet

pkg/utils/set.go:19–29  ·  view source on GitHub ↗
(v ...T)

Source from the content-addressed store, hash-verified

17type Set[T comparable] map[T]struct{}
18
19func NewSet[T comparable](v ...T) Set[T] {
20 if len(v) == 0 {
21 return make(Set[T])
22 }
23
24 out := make(Set[T], len(v))
25 for i := range v {
26 out.Add(v[i])
27 }
28 return out
29}
30
31func (s Set[T]) Has(v T) bool {
32 _, ok := s[v]

Callers 2

addBuildDependenciesFunction · 0.92
runUpFunction · 0.92

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected