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

deinstapel/argocd-ldap-rbac-sync: main.go; 5 LoC

Open
#15,489 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [deinstapel/argocd-ldap-rbac-sync](https://www.github.com/deinstapel/argocd-ldap-rbac-sync) at [main.go](https://github.com/deinstapel/argocd-ldap-rbac-sync/blob/ce781b7af66330c12b745edfca726bfa566eed0d/main.go#L120-L124)

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 p is reassigned at line 122

[Click here to see the code in its original context.](https://github.com/deinstapel/argocd-ldap-rbac-sync/blob/ce781b7af66330c12b745edfca726bfa566eed0d/main.go#L120-L124)

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

```go
for _, p := range projectListResponse.Items {
if p.Metadata.Name == groupCN {
existingProject = &p;
}
}

```

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: ce781b7af66330c12b745edfca726bfa566eed0d

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the referenced main.go lines 120-124 in deinstapel/argocd-ldap-rbac-sync and inspect how the range-loop variable p is used when existingProject is assigned. Determine whether the analyzer finding is a Bug, Mitigated, or Desirable Behavior, then record that classification with the corresponding reaction on this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.