fixed argument order

This commit is contained in:
milarin 2023-01-16 15:15:21 +01:00
parent 3a80460c18
commit 169f978e14

View File

@ -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)