diff --git a/adapter/outboundgroup/fallback.go b/adapter/outboundgroup/fallback.go index 15486111..2e754133 100644 --- a/adapter/outboundgroup/fallback.go +++ b/adapter/outboundgroup/fallback.go @@ -97,7 +97,7 @@ func (f *Fallback) SupportUDP() bool { // MarshalJSON implements C.ProxyAdapter func (f *Fallback) MarshalJSON() ([]byte, error) { - var all []string + all := []string{} for _, proxy := range f.proxies(false) { all = append(all, proxy.Name()) } diff --git a/adapter/outboundgroup/loadbalance.go b/adapter/outboundgroup/loadbalance.go index 0a4dce9c..3a326187 100644 --- a/adapter/outboundgroup/loadbalance.go +++ b/adapter/outboundgroup/loadbalance.go @@ -150,7 +150,7 @@ func (lb *LoadBalance) proxies(touch bool) []C.Proxy { // MarshalJSON implements C.ProxyAdapter func (lb *LoadBalance) MarshalJSON() ([]byte, error) { - var all []string + all := []string{} for _, proxy := range lb.proxies(false) { all = append(all, proxy.Name()) } diff --git a/adapter/outboundgroup/relay.go b/adapter/outboundgroup/relay.go index f75bd336..d9b29637 100644 --- a/adapter/outboundgroup/relay.go +++ b/adapter/outboundgroup/relay.go @@ -69,7 +69,7 @@ func (r *Relay) DialContext(ctx context.Context, metadata *C.Metadata, opts ...d // MarshalJSON implements C.ProxyAdapter func (r *Relay) MarshalJSON() ([]byte, error) { - var all []string + all := []string{} for _, proxy := range r.rawProxies(false) { all = append(all, proxy.Name()) } diff --git a/adapter/outboundgroup/selector.go b/adapter/outboundgroup/selector.go index 32a8f247..d3b58b3f 100644 --- a/adapter/outboundgroup/selector.go +++ b/adapter/outboundgroup/selector.go @@ -50,7 +50,7 @@ func (s *Selector) SupportUDP() bool { // MarshalJSON implements C.ProxyAdapter func (s *Selector) MarshalJSON() ([]byte, error) { - var all []string + all := []string{} for _, proxy := range getProvidersProxies(s.providers, false, s.filter) { all = append(all, proxy.Name()) } diff --git a/adapter/outboundgroup/urltest.go b/adapter/outboundgroup/urltest.go index 60b28273..98269e6a 100644 --- a/adapter/outboundgroup/urltest.go +++ b/adapter/outboundgroup/urltest.go @@ -123,7 +123,7 @@ func (u *URLTest) SupportUDP() bool { // MarshalJSON implements C.ProxyAdapter func (u *URLTest) MarshalJSON() ([]byte, error) { - var all []string + all := []string{} for _, proxy := range u.proxies(false) { all = append(all, proxy.Name()) }