github-vet / github-vet/rangeloop-pointer-findings
histrio/rssbook: cmd/rssbookcli/main.go; 24 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [histrio/rssbook](https://www.github.com/histrio/rssbook) at [cmd/rssbookcli/main.go](https://github.com/histrio/rssbook/blob/5f2b8f56be13b90842b9a72bf0396157a277aac8/cmd/rssbookcli/main.go#L121-L144)
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 epFile used in defer or goroutine at line 129
[Click here to see the code in its original context.](https://github.com/histrio/rssbook/blob/5f2b8f56be13b90842b9a72bf0396157a277aac8/cmd/rssbookcli/main.go#L121-L144)
Click here to show the 24 line(s) of Go which triggered the analyzer.
```go
for epFile := range cookAudio(src) {
pos = pos + 1
_, filename := filepath.Split(string(epFile))
go func() {
outFile := fmt.Sprintf("episode-%03d.mp3", pos)
utils.CopyFile(epFile, path.Join(dest, outFile))
utils.Check(err)
loggers.Info.Println("Issued: " + outFile)
}()
ep := utils.BookEpisode{
Pos: pos,
Name: fmt.Sprintf("Episode %03d", pos),
File: filename,
FileSize: utils.GetFileSize(epFile),
Href: utils.S3Url + book.ID + "/" + filename + ".mp3",
Duration: audio.GetDuration(epFile),
}
book.Episodes = append(book.Episodes, ep)
}
```
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: 5f2b8f56be13b90842b9a72bf0396157a277aac8
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.