From 5d557859368573446216e37ce1610e92f0f2783c Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Thu, 21 Feb 2013 19:48:54 +0100 Subject: [PATCH] Fix broken target scrape error propagation. --- retrieval/target.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/retrieval/target.go b/retrieval/target.go index c7187d4ec..b0352bfe7 100644 --- a/retrieval/target.go +++ b/retrieval/target.go @@ -138,7 +138,8 @@ func (t *target) Scrape(earliest time.Time, results chan format.Result) (err err done <- true }() - resp, err := http.Get(t.Address()) + var resp *http.Response // Don't shadow "err" from the enclosing function. + resp, err = http.Get(t.Address()) if err != nil { return }