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

openshift/ocs-operator: pkg/apis/ocs/v1/zz_generated.deepcopy.go; 11 LoC

Open
#6,886 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in openshift/ocs-operator at pkg/apis/ocs/v1/zz_generated.deepcopy.go

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 val is reassigned at line 249

Click here to see the code in its original context.

Click here to show the 11 line(s) of Go which triggered the analyzer.
		for key, val := range *in {
			var outVal []string
			if val == nil {
				(*out)[key] = nil
			} else {
				in, out := &val, &outVal
				*out = make(TopologyLabelValues, len(*in))
				copy(*out, *in)
			}
			(*out)[key] = outVal
		}

Leave a reaction on this issue to contribute to the project by classifying this instance as a Bug 👎, Mitigated 👍, or Desirable Behavior 🚀
See the descriptions of the classifications here for more information.

commit ID: f2de4756b6eafe52827a11c66ef0b198acad1a4c

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open pkg/apis/ocs/v1/zz_generated.deepcopy.go around lines 244-254 and read the analyzer report about the range-loop variable reassignment. Determine whether the reported behavior is a bug, mitigated, or desirable behavior, then leave the corresponding reaction on the issue. Completion means one of those classifications has been recorded.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.