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
|
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 {
|
for v := range source {
|
||||||
cancel()
|
cancel()
|
||||||
return &v
|
return &v
|
||||||
@ -25,7 +25,7 @@ func FindFirstAndFlush[T any](source <-chan T) *T {
|
|||||||
return nil
|
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 {
|
for v := range source {
|
||||||
cancel()
|
cancel()
|
||||||
go Flush(source)
|
go Flush(source)
|
||||||
|
Loading…
Reference in New Issue
Block a user