github-vet / github-vet/rangeloop-pointer-findings
ttacon/glorious: unit/unit.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [ttacon/glorious](https://www.github.com/ttacon/glorious) at [unit/unit.go](https://github.com/ttacon/glorious/blob/fdf03f45e98786e959445618cd9ba305cdb0280f/unit/unit.go#L274-L289)
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 slot is reassigned at line 280
[Click here to see the code in its original context.](https://github.com/ttacon/glorious/blob/fdf03f45e98786e959445618cd9ba305cdb0280f/unit/unit.go#L274-L289)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for i, slot := range u.Slots {
if slot.IsDefault() {
if defaultSlot != nil {
// Two slots are defined as default, result: barf.
return nil, errors.New("there can only be one default slot")
}
defaultSlot = &slot
}
val, err := slot.Resolve(u)
if err != nil {
return nil, err
}
resolverResults[i] = 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: fdf03f45e98786e959445618cd9ba305cdb0280f
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.