Skip to content

Commit

Permalink
chore - Marked untested functions
Browse files Browse the repository at this point in the history
  • Loading branch information
OZoneGuy committed Oct 15, 2023
1 parent 783f3ff commit 98f5028
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func Count[T any](f func(T) bool, a []T) int {
}

// Find returns the first element of a for which f returns true, or nil if there is no such element.
// WARN: Untested
func Find[T any](f func(T) bool, a []T) *T {
for _, v := range a {
if f(v) {
Expand All @@ -92,6 +93,7 @@ func Find[T any](f func(T) bool, a []T) *T {
}

// FindIndex returns the index of the first element of a for which f returns true, or -1 if there is no such element.
// WARN:Untested
func FindIndex[T any](f func(T) bool, a []T) int {
for i, v := range a {
if f(v) {
Expand All @@ -102,6 +104,7 @@ func FindIndex[T any](f func(T) bool, a []T) int {
}

// ForEeach calls f on each element of a.
// WARN: Untested
func ForEach[T any](f func(T), a []T) {
for _, v := range a {
f(v)
Expand Down

0 comments on commit 98f5028

Please sign in to comment.