github-vet / github-vet/rangeloop-pointer-findings
r-mbe/iccrawler: cockimport/full/full-river.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [r-mbe/iccrawler](https://www.github.com/r-mbe/iccrawler) at [cockimport/full/full-river.go](https://github.com/r-mbe/iccrawler/blob/e1685919ad62b075ccfd3c783a883c2b7c06c595/cockimport/full/full-river.go#L447-L454)
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 doc was used in a composite literal at line 452
[Click here to see the code in its original context.](https://github.com/r-mbe/iccrawler/blob/e1685919ad62b075ccfd3c783a883c2b7c06c595/cockimport/full/full-river.go#L447-L454)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for i, doc := range docs {
wg.Add(1)
jid += i
fmt.Printf("Adding ++++ job %d to the queue\n", jid)
// fmt.Printf("Adding ++++ job %d event: %v to the queue\n", jid, doc)
jb := job.Job{Name: fmt.Sprintf("%d", jid), Wg: wg, Event: &doc, Rnd: r, JobQueue: JobQueue, RandomFail: false, Retries: 1}
JobQueue <- jb
}
```
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: e1685919ad62b075ccfd3c783a883c2b7c06c595
Contributor guide
No contributing guide indexed for this repository
Research direction
Read cockimport/full/full-river.go around lines 447-454, starting with the range over docs and the job.Job composite literal. Check the referenced iccrawler context and determine whether the analyzer's range-loop reference is an actual bug; done means recording the appropriate classification or confirming the behavior as mitigated or desirable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100