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:22:41 +0000 (14:22 +0200)
commite38d38df83dab0d75c15837d6222a4d7f1111fa7
tree3f5a0c36ee50ef77de38ba8d56d0a744fc6dc5c9
parent99adc3db9a43223568607f563cb7a449ff5da852
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