github-vet / github-vet/rangeloop-pointer-findings
magma/magma: orc8r/cloud/go/services/metricsd/collection/metric_families.go; 13 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [magma/magma](https://www.github.com/magma/magma) at [orc8r/cloud/go/services/metricsd/collection/metric_families.go](https://github.com/magma/magma/blob/37a84596e7d5da78533e773b3c1f4534cae72f51/orc8r/cloud/go/services/metricsd/collection/metric_families.go#L49-L61)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.
> reference to val was used in a composite literal at line 58
[Click here to see the code in its original context.](https://github.com/magma/magma/blob/37a84596e7d5da78533e773b3c1f4534cae72f51/orc8r/cloud/go/services/metricsd/collection/metric_families.go#L49-L61)
Click here to show the 13 line(s) of Go which triggered the analyzer.
```go
for label, val := range gaugesByLabel {
clonedLabel := MetricLabel{Name: label.Name, Value: label.Value}
metrics = append(
metrics,
&io_prometheus_client.Metric{
Label: []*io_prometheus_client.LabelPair{
{Name: &clonedLabel.Name, Value: &clonedLabel.Value},
},
Gauge: &io_prometheus_client.Gauge{Value: &val},
},
)
}
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: 37a84596e7d5da78533e773b3c1f4534cae72f51
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.