github-vet / github-vet/rangeloop-pointer-findings
davidddw/packer-builder-cloud: src/github.com/mitchellh/packer/builder/amazon/common/artifact.go; 19 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [davidddw/packer-builder-cloud](https://www.github.com/davidddw/packer-builder-cloud) at [src/github.com/mitchellh/packer/builder/amazon/common/artifact.go](https://github.com/davidddw/packer-builder-cloud/blob/0d733c5ea51135e6d335bcb7ae73c6c5821624db/src/github.com/mitchellh/packer/builder/amazon/common/artifact.go#L69-L87)
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 imageId was used in a composite literal at line 80
[Click here to see the code in its original context.](https://github.com/davidddw/packer-builder-cloud/blob/0d733c5ea51135e6d335bcb7ae73c6c5821624db/src/github.com/mitchellh/packer/builder/amazon/common/artifact.go#L69-L87)
Click here to show the 19 line(s) of Go which triggered the analyzer.
```go
for region, imageId := range a.Amis {
log.Printf("Deregistering image ID (%s) from region (%s)", imageId, region)
regionConfig := &aws.Config{
Credentials: a.Conn.Config.Credentials,
Region: aws.String(region),
}
sess := session.New(regionConfig)
regionConn := ec2.New(sess)
input := &ec2.DeregisterImageInput{
ImageId: &imageId,
}
if _, err := regionConn.DeregisterImage(input); err != nil {
errors = append(errors, err)
}
// TODO(mitchellh): Delete the snapshots associated with an AMI too
}
```
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: 0d733c5ea51135e6d335bcb7ae73c6c5821624db
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.