Files
moby/daemon/libnetwork/internal/maputil/maputil.go
2025-07-14 09:25:39 -07:00

15 lines
335 B
Go

// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.23
package maputil
func FilterValues[K comparable, V any](in map[K]V, fn func(V) bool) []V {
var out []V
for _, v := range in {
if fn(v) {
out = append(out, v)
}
}
return out
}