From 95fa5a72c68b2b12697e323c263fdb9a23906548 Mon Sep 17 00:00:00 2001 From: zu1k Date: Sun, 16 Aug 2020 06:42:56 +0800 Subject: [PATCH] fix index out of range --- app/task.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/task.go b/app/task.go index 46297315..529c5730 100644 --- a/app/task.go +++ b/app/task.go @@ -68,8 +68,8 @@ func CrawlGo() { log.Println("CrawlGo clash useable node count:", len(proxies)) num := len(proxies) - for i := 1; i <= num; i++ { - proxies[i].SetName("tgbot.co_" + strconv.Itoa(i)) + for i := 0; i < num; i++ { + proxies[i].SetName("tgbot.co_" + strconv.Itoa(i+1)) } cache.SetProxies(proxies) cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())