Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added KeyExists #366

Closed
wants to merge 2 commits into from
Closed

Added KeyExists #366

wants to merge 2 commits into from

Conversation

lesichkovm
Copy link

No description provided.

map.go Outdated Show resolved Hide resolved
@lesichkovm
Copy link
Author

@samber can this be merged please?

@lesichkovm
Copy link
Author

@samber ?

@@ -1,5 +1,13 @@
package lo

// KeyExists returns wheter the given key exists.
func KeyExists[K comparable, V any](in map[K]V, key K) bool {
if _, ok := in[key]; ok {
Copy link
Contributor

@d-enk d-enk Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just

_, exist := in[key]
return exist

@samber
Copy link
Owner

samber commented Jun 28, 2024

I'm going to rename it to lo.HasKey before merge, to match the go standards.

Edit1: a file oryxBuildBinary has been committed 🧐

Edit2: I had some trouble to edit your PR, since I don't have permission to write to your fork. See #477

@samber samber mentioned this pull request Jun 28, 2024
@samber samber closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants