github-vet / github-vet/rangeloop-pointer-findings
google/exposure-notifications-server: internal/mirror/database/mirror.go; 9 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [google/exposure-notifications-server](https://www.github.com/google/exposure-notifications-server) at [internal/mirror/database/mirror.go](https://github.com/google/exposure-notifications-server/blob/5c73e7f7dcc926dcbe30dff02b02d2f62c702cf7/internal/mirror/database/mirror.go#L255-L263)
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 rewrittenFilename is reassigned at line 258
[Click here to see the code in its original context.](https://github.com/google/exposure-notifications-server/blob/5c73e7f7dcc926dcbe30dff02b02d2f62c702cf7/internal/mirror/database/mirror.go#L255-L263)
Click here to show the 9 line(s) of Go which triggered the analyzer.
```go
for fName, rewrittenFilename := range wantFiles {
var localFilename *string
if fName != rewrittenFilename {
localFilename = &rewrittenFilename
}
if _, err := tx.Exec(ctx, insertName, mirrorID, fName, localFilename); err != nil {
return fmt.Errorf("failed to insert mirrorfile: %w", err)
}
}
```
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: 5c73e7f7dcc926dcbe30dff02b02d2f62c702cf7
Contributor guide
No contributing guide indexed for this repository
Research direction
Read internal/mirror/database/mirror.go around lines 255-263 and the linked original context, then inspect how rewrittenFilename is used in the transaction. Compare the analyzer warning with the shown Go code and leave the requested Bug, Mitigated, or Desirable Behavior reaction; completion is a justified classification.
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
- 42/100