Make caser a local varialbe, not a global one.
authorMarcelo E. Magallon <marcelo.magallon@grafana.com>
Mon, 13 Jun 2022 23:21:41 +0000 (17:21 -0600)
committerJulien Pivotto <roidelapluie@gmail.com>
Fri, 17 Jun 2022 12:21:50 +0000 (14:21 +0200)
commit54ed14c82d7b6f3c788fde30ed5b208a2c157d5e
tree1563e50b3e252c3d7022cba9f6ce19f5531d45de
parent148a9de0681062f9680bd239d16d4a92678b4bc8
Make caser a local varialbe, not a global one.

The cases.Caser returned by calling cases.Title *cannot* be shared among
goroutines. This might happen when Prometheus tries to scrape multiple
targets at the same time. From the docs:

A Caser may be stateful and should therefore not be shared between
goroutines.

Fixes: #922

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
prober/http.go
prober/http_test.go