mirror of
https://github.com/moby/moby.git
synced 2026-07-24 16:26:51 +00:00
15 lines
335 B
Go
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
|
|
}
|