github-vet / github-vet/rangeloop-pointer-findings
nikcorg/tldr-cli: cli/tldr/find.go; 13 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [nikcorg/tldr-cli](https://www.github.com/nikcorg/tldr-cli) at [cli/tldr/find.go](https://github.com/nikcorg/tldr-cli/blob/7e07b6bdb4ea5e191a259d8b2fb857bf82760dbc/cli/tldr/find.go#L159-L171)
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 at line 161 may store a reference to entry
[Click here to see the code in its original context.](https://github.com/nikcorg/tldr-cli/blob/7e07b6bdb4ea5e191a259d8b2fb857bf82760dbc/cli/tldr/find.go#L159-L171)
Click here to show the 13 line(s) of Go which triggered the analyzer.
```go
for _, entry := range record.Entries {
searched++
if entry.Contains(needle) && filtersMatch(&entry, filters) {
log.Debugf("Found needle (%s) in %+v added on %v", needle, entry, record.Date)
e := entry
r := record
results = append(results, searchResult{&e, r})
if stopAfter > 0 && len(results) >= stopAfter {
return results
}
}
}
```
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: 7e07b6bdb4ea5e191a259d8b2fb857bf82760dbc
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.