github-vet / github-vet/rangeloop-pointer-findings
gildas/packer-hyperv: builder/amazon/common/step_modify_ami_attributes.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [gildas/packer-hyperv](https://www.github.com/gildas/packer-hyperv) at [builder/amazon/common/step_modify_ami_attributes.go](https://github.com/gildas/packer-hyperv/blob/82a7f6ef9718740e272b21a4a3fce720b0c4fb77/builder/amazon/common/step_modify_ami_attributes.go#L89-L106)
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 ami is reassigned at line 97
[Click here to see the code in its original context.](https://github.com/gildas/packer-hyperv/blob/82a7f6ef9718740e272b21a4a3fce720b0c4fb77/builder/amazon/common/step_modify_ami_attributes.go#L89-L106)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for region, ami := range amis {
ui.Say(fmt.Sprintf("Modifying attributes on AMI (%s)...", ami))
regionconn := ec2.New(&aws.Config{
Credentials: ec2conn.Config.Credentials,
Region: aws.String(region),
})
for name, input := range options {
ui.Message(fmt.Sprintf("Modifying: %s", name))
input.ImageId = &ami
_, err := regionconn.ModifyImageAttribute(input)
if err != nil {
err := fmt.Errorf("Error modify AMI attributes: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
}
}
```
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: 82a7f6ef9718740e272b21a4a3fce720b0c4fb77
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.