mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-07-04 20:02:34 +08:00
feat: 增加不输出国家策略组功能
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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("模板文件不存在")
|
||||
|
Reference in New Issue
Block a user