Skip to content

Commit

Permalink
Update map.go
Browse files Browse the repository at this point in the history
  • Loading branch information
samber authored Jun 28, 2024
1 parent 5585cbb commit cfedfab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func Keys[K comparable, V any](in map[K]V) []K {
}

// HasKey returns whether the given key exists.
// Play: https://go.dev/play/p/aVwubIvECqS
func HasKey[K comparable, V any](in map[K]V, key K) bool {
_, ok := in[key]
return ok
Expand Down

0 comments on commit cfedfab

Please sign in to comment.