github-vet / github-vet/rangeloop-pointer-findings
fishedee/MyManager: server/models/account/accountao_testing.go; 5 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [fishedee/MyManager](https://www.github.com/fishedee/MyManager) at [server/models/account/accountao_testing.go](https://github.com/fishedee/MyManager/blob/20bb83a9e89124b2483187d2e7e71e5a657d144b/server/models/account/accountao_testing.go#L364-L368)
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.
>
[Click here to see the code in its original context.](https://github.com/fishedee/MyManager/blob/20bb83a9e89124b2483187d2e7e71e5a657d144b/server/models/account/accountao_testing.go#L364-L368)
Click here to show the 5 line(s) of Go which triggered the analyzer.
```go
for index, singleAddData := range accountAddData {
singleAddData.AccountId = 10001 + index
this.AccountAo.Add(10001, singleAddData)
this.DB.Where("AccountId = ?", singleAddData.AccountId).NoAutoTime().Cols("CreateTime,ModifyTime").Update(&singleAddData)
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.
root signature {Update 1} was not found in the callgraph; reference was passed directly to third-party code
```
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: 20bb83a9e89124b2483187d2e7e71e5a657d144b
Contributor guide
No contributing guide indexed for this repository
Research direction
Open server/models/account/accountao_testing.go around lines 364-368 and review the range-loop variable use shown in the report. Compare it with the linked analyzer guidance, then classify the finding as Bug, Mitigated, or Desirable Behavior using the corresponding reaction. The task is done when the classification reaction is added.
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
- Mostly clear
- Newbie friendliness
- 25/100