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

johnt337/awscli: cmd/ec2_tag/main.go; 4 LoC

Open
#17,918 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 [johnt337/awscli](https://www.github.com/johnt337/awscli) at [cmd/ec2_tag/main.go](https://github.com/johnt337/awscli/blob/b2166e39fd14572907da516bc07646cdd57716a6/cmd/ec2_tag/main.go#L105-L108)

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 resource is reassigned at line 107

[Click here to see the code in its original context.](https://github.com/johnt337/awscli/blob/b2166e39fd14572907da516bc07646cdd57716a6/cmd/ec2_tag/main.go#L105-L108)

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

```go
for pos, resource := range resources {
debugf("[DEBUG]: tagging resource: '%s'\n", resource)
ec2Resources[pos] = &resource
}

```

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect cmd/ec2_tag/main.go around lines 105-108 and read the linked analyzer context first. Determine whether the reported range-loop reference is a real bug, mitigated, or desirable behavior, then leave the corresponding reaction; no test or separate entry point is mentioned.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.