From b8909542a930466144643aeff0b23397fee4779c Mon Sep 17 00:00:00 2001 From: Alex Efros Date: Mon, 29 Aug 2022 01:10:36 +0300 Subject: [PATCH] feat: relax FindKeyBy constraint (#205) --- find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find.go b/find.go index 3874f7f8..e40bfcc8 100644 --- a/find.go +++ b/find.go @@ -98,7 +98,7 @@ func FindKey[K comparable, V comparable](object map[K]V, value V) (K, bool) { } // FindKeyBy returns the key of the first element predicate returns truthy for. -func FindKeyBy[K comparable, V comparable](object map[K]V, predicate func(K, V) bool) (K, bool) { +func FindKeyBy[K comparable, V any](object map[K]V, predicate func(K, V) bool) (K, bool) { for k, v := range object { if predicate(k, v) { return k, true