Skip to content

Commit

Permalink
Merge pull request #30 from dwurf/spelling-grammar-pass
Browse files Browse the repository at this point in the history
slices: misc improvements to godoc
  • Loading branch information
orsinium authored Nov 14, 2023
2 parents 1947323 + 787c8fa commit a795688
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 86 deletions.
12 changes: 6 additions & 6 deletions slices/async_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
)

// AllAsync returns true if f returns true for all elements in slice.
// AllAsync returns true if f returns true for all elements in items.
//
// This is an asynchronous function. It will spawn as many goroutines as you specify
// in the `workers` argument. Set it to zero to spawn a new goroutine for each item.
Expand Down Expand Up @@ -69,7 +69,7 @@ func AllAsync[S ~[]T, T any](items S, workers int, f func(el T) bool) bool {
return true
}

// AnyAsync returns true if f returns true for any element from slice
// AnyAsync returns true if f returns true for any element in items.
//
// This is an asynchronous function. It will spawn as many goroutines as you specify
// in the `workers` argument. Set it to zero to spawn a new goroutine for each item.
Expand Down Expand Up @@ -133,7 +133,7 @@ func AnyAsync[S ~[]T, T any](items S, workers int, f func(el T) bool) bool {
return false
}

// EachAsync calls f for every element from slice
// EachAsync calls f for each element in items.
//
// This is an asynchronous function. It will spawn as many goroutines as you specify
// in the `workers` argument. Set it to zero to spawn a new goroutine for each item.
Expand Down Expand Up @@ -167,7 +167,7 @@ func EachAsync[S ~[]T, T any](items S, workers int, f func(el T)) {
wg.Wait()
}

// FilterAsync returns slice of element for which f returns true
// FilterAsync returns a slice containing only items where f returns true
//
// This is an asynchronous function. It will spawn as many goroutines as you specify
// in the `workers` argument. Set it to zero to spawn a new goroutine for each item.
Expand Down Expand Up @@ -215,7 +215,7 @@ func FilterAsync[S ~[]T, T any](items S, workers int, f func(el T) bool) S {
return result
}

// MapAsync applies F to all elements in slice of T and returns slice of results
// MapAsync applies f to all elements in items and returns a slice of the results.
//
// This is an asynchronous function. It will spawn as many goroutines as you specify
// in the `workers` argument. Set it to zero to spawn a new goroutine for each item.
Expand Down Expand Up @@ -253,7 +253,7 @@ func MapAsync[S ~[]T, T any, G any](items S, workers int, f func(el T) G) []G {
return result
}

// ReduceAsync reduces slice to a single value with f.
// ReduceAsync reduces items to a single value with f.
//
// This is an asynchronous function. It will spawn as many goroutines as you specify
// in the `workers` argument. Set it to zero to spawn a new goroutine for each item.
Expand Down
Loading

0 comments on commit a795688

Please sign in to comment.