feat: 增加不输出国家策略组功能

This commit is contained in:
2024-03-10 13:26:35 +08:00
parent 65dccc3b51
commit 94a320a682
7 changed files with 175 additions and 295 deletions

View File

@ -65,17 +65,11 @@ func AddProxy(
countryName := GetContryName(proxy.Name)
for i := range sub.ProxyGroups {
group := &sub.ProxyGroups[i]
if group.Name == countryName {
group.Proxies = append(group.Proxies, proxy.Name)
group.Size++
haveProxyGroup = true
}
if group.Name == "手动切换" {
group.Proxies = append(group.Proxies, proxy.Name)
group.Size++
}
}
if !haveProxyGroup {
var newGroup model.ProxyGroup

View File

@ -81,8 +81,5 @@ func FetchSubscriptionFromAPI(url string) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("failed to write to sub.yaml: %w", err)
}
if err != nil {
return nil, fmt.Errorf("failed to unmarshal yaml: %w", err)
}
return data, nil
}

View File

@ -25,9 +25,6 @@ func LoadTemplate(template string) ([]byte, error) {
if err != nil {
return nil, err
}
if err != nil {
return nil, err
}
return result, nil
}
return nil, errors.New("模板文件不存在")