From b98a5acb5762ba899498f306690122c322196609 Mon Sep 17 00:00:00 2001 From: arugaki Date: Thu, 22 Nov 2018 12:13:52 +0800 Subject: [PATCH] fix buf redeclared in scrapeloop (#4873) * buf Has been declared in scrape.go in line 785, I think it is unnecessary to declare a new variable again here. Signed-off-by: arugakiWei * delete the buf in line 785 because it is never used. Signed-off-by: arugakiWei --- scrape/scrape.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/scrape/scrape.go b/scrape/scrape.go index 5b40bf905..382d2533c 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -781,11 +781,8 @@ func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) { ticker := time.NewTicker(interval) defer ticker.Stop() - buf := bytes.NewBuffer(make([]byte, 0, 16000)) - mainLoop: for { - buf.Reset() select { case <-sl.ctx.Done(): close(sl.stopped)