-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
To address #3384, in #3386 I modified the description and signature of the collections.Where function from:
Returns the given collection, removing elements that do not satisfy the comparison condition.
collections.Where COLLECTION KEY [OPERATOR] VALUE
To:
Returns a slice by filtering the given slice based on a key, operator, and value.
collections.Where SLICE KEY [OPERATOR] VALUE
But the source code and associated tests indicate that you can use collections.Where with maps as well.
Using it with a slice makes sense, just like a WHERE clause in a SQL query. Using it with a map is, at least to me, counter-intuitive, but perhaps I just haven't come across a real-world example.
Reactions are currently unavailable