From 169f978e1490cbd9a9461e33e5ece17b4d917aac Mon Sep 17 00:00:00 2001 From: milarin Date: Mon, 16 Jan 2023 15:15:21 +0100 Subject: [PATCH] fixed argument order --- find.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)