github-vet / github-vet/rangeloop-pointer-findings

alexeldeib/incendiary-iguana: pkg/clients/loadbalancers/spec.go; 16 LoC

Open Beginner friendly
#11,182 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [alexeldeib/incendiary-iguana](https://www.github.com/alexeldeib/incendiary-iguana) at [pkg/clients/loadbalancers/spec.go](https://github.com/alexeldeib/incendiary-iguana/blob/84f19b0e3fba968147de438f2dcad3cb6800360b/pkg/clients/loadbalancers/spec.go#L66-L81)

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 frontend was used in a composite literal at line 75

[Click here to see the code in its original context.](https://github.com/alexeldeib/incendiary-iguana/blob/84f19b0e3fba968147de438f2dcad3cb6800360b/pkg/clients/loadbalancers/spec.go#L66-L81)

Click here to show the 16 line(s) of Go which triggered the analyzer.

```go
for _, frontend := range frontends {
// TODO(ace): name these properly? but remember they must be unique (maybe a map[string]string of name:ID?)
parts := strings.Split(frontend, "/")
resourceName := parts[len(parts)-1]

item := network.FrontendIPConfiguration{
Name: &resourceName,
FrontendIPConfigurationPropertiesFormat: &network.FrontendIPConfigurationPropertiesFormat{
PublicIPAddress: &network.PublicIPAddress{
ID: &frontend,
},
},
}

*s.internal.FrontendIPConfigurations = append(*s.internal.FrontendIPConfigurations, item)
}

```

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: 84f19b0e3fba968147de438f2dcad3cb6800360b

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with pkg/clients/loadbalancers/spec.go at lines 66-81 and read how the range variable is used when building frontend IP configurations. Check whether the reported reference behavior is a bug, mitigated, or desirable in this context, then leave the corresponding reaction on the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.