Range var capturing?

This commit is contained in:
Josh Deprez 2023-01-07 17:49:22 +11:00
parent ea6f44e867
commit 619e4409e1
No known key found for this signature in database
1 changed files with 1 additions and 0 deletions

View File

@ -182,6 +182,7 @@ func main() {
// These are GaugeFuncs to more closely align Prometheus scrape time with
// the modbus scrape time.
for addr, reg := range sungrowInputRegs {
addr, reg := addr, reg
promauto.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: "sungrow",