From 61438cb955505d6c22e98745c796617aab71bfcc Mon Sep 17 00:00:00 2001 From: wuqinqiang <1185079673@qq.com> Date: Thu, 21 Dec 2023 11:30:32 +0800 Subject: [PATCH] feat: replace Try0 to std --- pkg/util/wait/backoff.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/util/wait/backoff.go b/pkg/util/wait/backoff.go index bb3e50d6..048c9591 100644 --- a/pkg/util/wait/backoff.go +++ b/pkg/util/wait/backoff.go @@ -19,8 +19,6 @@ import ( "sync" "time" - "github.com/samber/lo" - "github.com/fatedier/frp/pkg/util/util" ) @@ -186,7 +184,7 @@ func MergeAndCloseOnAnyStopChannel[T any](upstreams ...<-chan T) <-chan T { closeOnce := sync.Once{} for _, upstream := range upstreams { ch := upstream - go lo.Try0(func() { + go func() { select { case <-ch: closeOnce.Do(func() { @@ -194,7 +192,7 @@ func MergeAndCloseOnAnyStopChannel[T any](upstreams ...<-chan T) <-chan T { }) case <-out: } - }) + }() } return out }