github-vet / github-vet/rangeloop-pointer-findings
RobloxAPI/rbxapiref: cmd/rbxapiref/data.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [RobloxAPI/rbxapiref](https://www.github.com/RobloxAPI/rbxapiref) at [cmd/rbxapiref/data.go](https://github.com/RobloxAPI/rbxapiref/blob/7a0c1c825abc0f420a1ecb4c9335cf0169a367c0/cmd/rbxapiref/data.go#L163-L180)
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 page is reassigned at line 174
[Click here to see the code in its original context.](https://github.com/RobloxAPI/rbxapiref/blob/7a0c1c825abc0f420a1ecb4c9335cf0169a367c0/cmd/rbxapiref/data.go#L163-L180)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for _, page := range pages {
if page.File == "" {
continue
}
file, err := os.Create(filepath.Join(data.Settings.Output.Root, page.File))
if err != nil {
return fmt.Errorf("create file: %w", err)
}
if page.Data == nil {
page.Data = data
}
rootData.Page = &page
err = data.Templates.ExecuteTemplate(file, rootData.MainPage.Template, rootData)
file.Close()
if err != nil {
return fmt.Errorf("generate page: %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: 7a0c1c825abc0f420a1ecb4c9335cf0169a367c0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.