mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
536 B
536 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| HasKey | haskey | map.go#L47 | core | map | https://go.dev/play/p/aVwubIvECqS |
|
|
20 |
|
Returns whether the given key exists in the map.
exists := lo.HasKey(map[string]int{"foo": 1, "bar": 2}, "foo")
// true
exists = lo.HasKey(map[string]int{"foo": 1, "bar": 2}, "baz")
// false