Goldziher / go-utils

Simple and performant utilies using Go generics inspired by JavaScript and Python
https://goldziher.github.io/go-utils/
MIT License
46 stars 13 forks source link

(chore): add findIndexBy function to sliceutils #30

Closed K-A-I-L-A-S-H closed 1 year ago

K-A-I-L-A-S-H commented 1 year ago

Adds a util function to sliceutils to find the index of the element of the slice which satisfies the given predicate function. Adds unit test for the same.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

K-A-I-L-A-S-H commented 1 year ago

Appears to be more or less if not exactly like FindIndex