From 96c848dd5e5678f75995353e367d217d3d6a4537 Mon Sep 17 00:00:00 2001 From: Igor V Belousov Date: Tue, 23 Nov 2021 18:21:05 +0300 Subject: [PATCH] Chapter 1 - fetchall.go add comments --- ch1/fetchall.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch1/fetchall.go b/ch1/fetchall.go index d9bb043..91e8d96 100644 --- a/ch1/fetchall.go +++ b/ch1/fetchall.go @@ -26,11 +26,11 @@ func fetch(url string, ch chan<- string) { start := time.Now() resp, err := http.Get(url) if err != nil { - ch <- fmt.Sprint(err) + ch <- fmt.Sprint(err) // Отправка в канал ch return } nbytes, err := io.Copy(ioutil.Discard, resp.Body) - resp.Body.Close() + resp.Body.Close() //Исключение утечки ресурсов if err != nil { ch <- fmt.Sprintf("while reading %s: %v", url, err) return