fixed argument order
This commit is contained in:
parent
3a80460c18
commit
169f978e14
4
find.go
4
find.go
@ -9,7 +9,7 @@ func FindFirst[T any](source <-chan T) *T {
|
||||
return nil
|
||||
}
|
||||
|
||||
func FindFirstAndCancel[T any](cancel context.CancelFunc, source <-chan T) *T {
|
||||
func FindFirstAndCancel[T any](source <-chan T, cancel context.CancelFunc) *T {
|
||||
for v := range source {
|
||||
cancel()
|
||||
return &v
|
||||
@ -25,7 +25,7 @@ func FindFirstAndFlush[T any](source <-chan T) *T {
|
||||
return nil
|
||||
}
|
||||
|
||||
func FindFirstAndCancelFlush[T any](cancel context.CancelFunc, source <-chan T) *T {
|
||||
func FindFirstAndCancelFlush[T any](source <-chan T, cancel context.CancelFunc) *T {
|
||||
for v := range source {
|
||||
cancel()
|
||||
go Flush(source)
|
||||
|
Loading…
Reference in New Issue
Block a user