feat: replace Try0 to std
This commit is contained in:
parent
8adf35d480
commit
61438cb955
@ -19,8 +19,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/samber/lo"
|
|
||||||
|
|
||||||
"github.com/fatedier/frp/pkg/util/util"
|
"github.com/fatedier/frp/pkg/util/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -186,7 +184,7 @@ func MergeAndCloseOnAnyStopChannel[T any](upstreams ...<-chan T) <-chan T {
|
|||||||
closeOnce := sync.Once{}
|
closeOnce := sync.Once{}
|
||||||
for _, upstream := range upstreams {
|
for _, upstream := range upstreams {
|
||||||
ch := upstream
|
ch := upstream
|
||||||
go lo.Try0(func() {
|
go func() {
|
||||||
select {
|
select {
|
||||||
case <-ch:
|
case <-ch:
|
||||||
closeOnce.Do(func() {
|
closeOnce.Do(func() {
|
||||||
@ -194,7 +192,7 @@ func MergeAndCloseOnAnyStopChannel[T any](upstreams ...<-chan T) <-chan T {
|
|||||||
})
|
})
|
||||||
case <-out:
|
case <-out:
|
||||||
}
|
}
|
||||||
})
|
}()
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user