github-vet / github-vet/rangeloop-pointer-findings
macarrie/flemzerd: downloaders/collection.go; 6 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [macarrie/flemzerd](https://www.github.com/macarrie/flemzerd) at [downloaders/collection.go](https://github.com/macarrie/flemzerd/blob/124e73831c324b85dd8f6ef96e66e5400fa8c569/downloaders/collection.go#L165-L170)
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.
> function call which takes a reference to torrent at line 169 may start a goroutine
[Click here to see the code in its original context.](https://github.com/macarrie/flemzerd/blob/124e73831c324b85dd8f6ef96e66e5400fa8c569/downloaders/collection.go#L165-L170)
Click here to show the 6 line(s) of Go which triggered the analyzer.
```go
for _, torrent := range downloadingItem.TorrentList {
if torrent.ID == currentTorrent.ID {
continue
}
db.Client.Unscoped().Delete(&torrent)
}
```
Click here to show extra information the analyzer produced.
```
The following dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
no paths found; call may have ended in third-party code; stay tuned for diagnostics
```
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: 124e73831c324b85dd8f6ef96e66e5400fa8c569
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in downloaders/collection.go at lines 165-170 and inspect the range loop together with the db.Client.Unscoped().Delete call. Check whether the reference to torrent can escape or be used by a goroutine, noting that the analyzer found no callgraph path. Done means classifying the finding as a bug, mitigated, or desirable behavior with supporting reasoning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100