chore: Fix fmt in #321

Replace all double spaces to tabs due to Go fmt proposal.
This commit is contained in:
H1JK
2023-01-07 12:24:28 +08:00
parent cd7134e309
commit fd48c6df8a
10 changed files with 75 additions and 71 deletions

View File

@ -3,24 +3,26 @@ package outboundgroup
import (
"context"
"fmt"
"strings"
"sync"
"time"
"github.com/Dreamacro/clash/adapter/outbound"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/constant/provider"
types "github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel"
"github.com/dlclark/regexp2"
"go.uber.org/atomic"
"strings"
"sync"
"time"
)
type GroupBase struct {
*outbound.Base
filterRegs []*regexp2.Regexp
excludeFilterReg *regexp2.Regexp
excludeTypeArray []string
excludeTypeArray []string
providers []provider.ProxyProvider
failedTestMux sync.Mutex
failedTimes int
@ -34,7 +36,7 @@ type GroupBaseOption struct {
outbound.BaseOption
filter string
excludeFilter string
excludeType string
excludeType string
providers []provider.ProxyProvider
}
@ -43,10 +45,10 @@ func NewGroupBase(opt GroupBaseOption) *GroupBase {
if opt.excludeFilter != "" {
excludeFilterReg = regexp2.MustCompile(opt.excludeFilter, 0)
}
var excludeTypeArray []string
if opt.excludeType!="" {
excludeTypeArray=strings.Split(opt.excludeType,"|")
}
var excludeTypeArray []string
if opt.excludeType != "" {
excludeTypeArray = strings.Split(opt.excludeType, "|")
}
var filterRegs []*regexp2.Regexp
if opt.filter != "" {
@ -60,7 +62,7 @@ func NewGroupBase(opt GroupBaseOption) *GroupBase {
Base: outbound.NewBase(opt.BaseOption),
filterRegs: filterRegs,
excludeFilterReg: excludeFilterReg,
excludeTypeArray: excludeTypeArray,
excludeTypeArray: excludeTypeArray,
providers: opt.providers,
failedTesting: atomic.NewBool(false),
}
@ -155,24 +157,24 @@ func (gb *GroupBase) GetProxies(touch bool) []C.Proxy {
}
proxies = newProxies
}
if gb.excludeTypeArray !=nil{
var newProxies []C.Proxy
for _, p := range proxies {
mType := p.Type().String()
flag:=false
for i := range gb.excludeTypeArray {
if(strings.EqualFold(mType,gb.excludeTypeArray[i])){
flag=true
}
if gb.excludeTypeArray != nil {
var newProxies []C.Proxy
for _, p := range proxies {
mType := p.Type().String()
flag := false
for i := range gb.excludeTypeArray {
if strings.EqualFold(mType, gb.excludeTypeArray[i]) {
flag = true
}
}
if(flag){
continue
}
newProxies = append(newProxies, p)
}
proxies = newProxies
}
}
if flag {
continue
}
newProxies = append(newProxies, p)
}
proxies = newProxies
}
if gb.excludeFilterReg != nil {
var newProxies []C.Proxy