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 <arugaki.wei@daocloud.io>

* delete the buf in line 785 because  it is never used.

Signed-off-by: arugakiWei <arugaki.wei@daocloud.io>
This commit is contained in:
arugaki 2018-11-22 12:13:52 +08:00 committed by Julius Volz
parent bd100182b2
commit b98a5acb57

View file

@ -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)