Skip to content

Commit

Permalink
Again, better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram Van de Walle committed Aug 16, 2024
1 parent 9be284c commit 1adbd1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions find.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func Sample[T any](collection []T) T {
return result
}

// Sample returns a seeded random item from collection, using intFunc as the random index generator.
// SampleBy returns a random item from collection, using intFunc as the random index generator.
func SampleBy[T any](collection []T, intFunc func(int) int) T {
size := len(collection)
if size == 0 {
Expand All @@ -494,7 +494,7 @@ func Samples[T any, Slice ~[]T](collection Slice, count int) Slice {
return results
}

// Samples returns N seeded random unique items from collection, using intFunc as the random index generator.
// SamplesBy returns N random unique items from collection, using intFunc as the random index generator.
func SamplesBy[T any, Slice ~[]T](collection Slice, count int, intFunc func(int) int) Slice {
size := len(collection)

Expand Down

0 comments on commit 1adbd1a

Please sign in to comment.