github-vet / github-vet/rangeloop-pointer-findings
haalcala/aws-eks-mattermost-env-setup: mattermost-env-setup-stage-1/mattermost-env-setup.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [haalcala/aws-eks-mattermost-env-setup](https://www.github.com/haalcala/aws-eks-mattermost-env-setup) at [mattermost-env-setup-stage-1/mattermost-env-setup.go](https://github.com/haalcala/aws-eks-mattermost-env-setup/blob/15a63473465fb0fb8cbf05a7a9f8e997e30ecbf7/mattermost-env-setup-stage-1/mattermost-env-setup.go#L471-L481)
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 subnet is reassigned at line 478
[Click here to see the code in its original context.](https://github.com/haalcala/aws-eks-mattermost-env-setup/blob/15a63473465fb0fb8cbf05a7a9f8e997e30ecbf7/mattermost-env-setup-stage-1/mattermost-env-setup.go#L471-L481)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for _, subnet := range subnets {
fmt.Println("subnet:", subnet)
for _, tag := range subnet.Tags {
if tag.Key == "Name" && strings.HasPrefix(tag.Value, fmt.Sprintf("%sinternal-", SUBNET_NAME_PREFIX)) {
subnetIds = append(subnetIds, subnet.SubnetId)
}
if firstPublicSubnet == nil && tag.Key == "Name" && strings.HasPrefix(tag.Value, fmt.Sprintf("%spublic-", SUBNET_NAME_PREFIX)) {
firstPublicSubnet = &subnet
}
}
}
```
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: 15a63473465fb0fb8cbf05a7a9f8e997e30ecbf7
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.