diff --git a/find.go b/find.go index 9a2fa6f..a840bbf 100644 --- a/find.go +++ b/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)