这段go程序会把内存全部消耗光

netaxcess · · 2879 次点击
wg.Add(1) 改到 for _,v :=range goods_urls { 下面。 wg.Done() 改成 defer wg.Done() 放在go func(url string,proxy string ,cat_id int,img string,id int) { 下。 wg.Wait() 改到原代码中 wg.Done()的位置。 limit应该可以去了。
#10
更多评论
polaris
社区,需要你我一同完善!
请求 url 内容后,有 close 吗?该释放的资源,有没有释放呢?
#1
有关闭 defer res.Body.Close()
#2