Browse Source

fix index out of range

zu1k 5 years ago
parent
commit
95fa5a72c6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/task.go

+ 2 - 2
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())