github-vet / github-vet/rangeloop-pointer-findings
denismakogon/omega2-apps: serverless/twitter-daemon/main.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [denismakogon/omega2-apps](https://www.github.com/denismakogon/omega2-apps) at [serverless/twitter-daemon/main.go](https://github.com/denismakogon/omega2-apps/blob/06a68031ffc97a669b1eb821ab1922ec9e1280ee/serverless/twitter-daemon/main.go#L32-L42)
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.
> range-loop variable tweet used in defer or goroutine at line 36
[Click here to see the code in its original context.](https://github.com/denismakogon/omega2-apps/blob/06a68031ffc97a669b1eb821ab1922ec9e1280ee/serverless/twitter-daemon/main.go#L32-L42)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for _, tweet := range tweets {
omega.PrintTweetInfo(tweet)
go func() {
defer wg.Done()
err = proc(tweet, httpClient, fnAPIURL, fnToken)
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
}()
}
```
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: 06a68031ffc97a669b1eb821ab1922ec9e1280ee
Contributor guide
No contributing guide indexed for this repository
Research direction
Read serverless/twitter-daemon/main.go at lines 32-42 and inspect how the goroutine uses tweet for each loop iteration. Determine whether the reported range-loop capture can process the wrong tweet, then classify the finding as Bug, Mitigated, or Desirable Behavior using the issue's reaction guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100