github-vet / github-vet/rangeloop-pointer-findings
hrfee/jfa-go: api.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [hrfee/jfa-go](https://www.github.com/hrfee/jfa-go) at [api.go](https://github.com/hrfee/jfa-go/blob/91252730366ea34a9feb2a7936b9e0fc14a1beb2/api.go#L339-L354)
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 address used in defer or goroutine at line 346
[Click here to see the code in its original context.](https://github.com/hrfee/jfa-go/blob/91252730366ea34a9feb2a7936b9e0fc14a1beb2/api.go#L339-L354)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for address, settings := range invite.Notify {
if settings["notify-creation"] {
go func() {
msg, err := app.email.constructCreated(req.Code, req.Username, req.Email, invite, app)
if err != nil {
app.err.Printf("%s: Failed to construct user creation notification", req.Code)
app.debug.Printf("%s: Error: %s", req.Code, err)
} else if err := app.email.send(address, msg); err != nil {
app.err.Printf("%s: Failed to send user creation notification", req.Code)
app.debug.Printf("%s: Error: %s", req.Code, err)
} else {
app.info.Printf("%s: Sent user creation notification to %s", req.Code, address)
}
}()
}
}
```
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: 91252730366ea34a9feb2a7936b9e0fc14a1beb2
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.