From 3a3fad3d32b7dfd8078eaddc75a408bae8de000b Mon Sep 17 00:00:00 2001 From: gVisor bot 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()) }