From 53b5ef199f9e5810b63ea9fff7efbf2b912d0b9d Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Mon, 4 Feb 2019 09:39:17 +0800 Subject: [PATCH] Fix: parse proxies shadow variable --- config/config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 979da3ef..8d9baa4b 100644 --- a/config/config.go +++ b/config/config.go @@ -251,6 +251,7 @@ func parseProxies(cfg *rawConfig) (map[string]C.Proxy, error) { return nil, fmt.Errorf("ProxyGroup %s: the duplicate name", groupName) } var group C.Proxy + var ps []C.Proxy var err error switch groupType { case "url-test": @@ -260,7 +261,7 @@ func parseProxies(cfg *rawConfig) (map[string]C.Proxy, error) { break } - ps, err := getProxies(proxies, urlTestOption.Proxies) + ps, err = getProxies(proxies, urlTestOption.Proxies) if err != nil { return nil, fmt.Errorf("ProxyGroup %s: %s", groupName, err.Error()) } @@ -272,7 +273,7 @@ func parseProxies(cfg *rawConfig) (map[string]C.Proxy, error) { break } - ps, err := getProxies(proxies, selectorOption.Proxies) + ps, err = getProxies(proxies, selectorOption.Proxies) if err != nil { return nil, fmt.Errorf("ProxyGroup %s: %s", groupName, err.Error()) } @@ -284,7 +285,7 @@ func parseProxies(cfg *rawConfig) (map[string]C.Proxy, error) { break } - ps, err := getProxies(proxies, fallbackOption.Proxies) + ps, err = getProxies(proxies, fallbackOption.Proxies) if err != nil { return nil, fmt.Errorf("ProxyGroup %s: %s", groupName, err.Error()) }