github-vet / github-vet/rangeloop-pointer-findings
JonatanOrdonez/tr-backend: services/domainService.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [JonatanOrdonez/tr-backend](https://www.github.com/JonatanOrdonez/tr-backend) at [services/domainService.go](https://github.com/JonatanOrdonez/tr-backend/blob/73463496659333166bf1cf855c9f89ec112bdab2/services/domainService.go#L272-L287)
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 server is reassigned at line 274
[Click here to see the code in its original context.](https://github.com/JonatanOrdonez/tr-backend/blob/73463496659333166bf1cf855c9f89ec112bdab2/services/domainService.go#L272-L287)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for _, server := range servers {
if lowerServer == nil {
lowerServer = &server
}
lowerGrade := 0
currentGrade := 0
if lowerServer.SslGrade != "" {
lowerGrade = int([]rune(lowerServer.SslGrade)[0])
}
if server.SslGrade != "" {
currentGrade = int([]rune(server.SslGrade)[0])
}
if (lowerGrade - currentGrade) > 0 {
lowerServer = &server
}
}
```
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: 73463496659333166bf1cf855c9f89ec112bdab2
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.