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

View file

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