github-vet / github-vet/rangeloop-pointer-findings
hyeoncheon/uart: actions/apps.go; 8 LoC
- 主要言語
- 言語のデータがありません
- スター
- 0
- フォーク
- 0
- PR マージ指標
- PR 指標を取得中
説明
Found a possible issue in [hyeoncheon/uart](https://www.github.com/hyeoncheon/uart) at [actions/apps.go](https://github.com/hyeoncheon/uart/blob/7305ff4e45900d325c8b48c2cf7bbd86e063b243/actions/apps.go#L185-L192)
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/hyeoncheon/uart/blob/7305ff4e45900d325c8b48c2cf7bbd86e063b243/actions/apps.go#L185-L192)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for _, role := range *app.GetRoles() {
rolemaps := &[]models.RoleMap{}
tx.Where("role_id = ?", role.ID).All(rolemaps)
for _, rm := range *rolemaps {
c.Logger().Infof("delete rmap %v: %v", rm.ID, tx.Destroy(&rm))
}
c.Logger().Infof("delete role %v: %v", role.ID, tx.Destroy(&role))
}
```
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 {Destroy 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: 7305ff4e45900d325c8b48c2cf7bbd86e063b243
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
コミット 7305ff4e45900d325c8b48c2cf7bbd86e063b243 の actions/apps.go の 185-192 行目を読み、報告された range ループでのポインタ使用について、周辺の呼び出し経路を調査してください。アナライザーの検出結果がバグ、緩和された動作、または望ましい動作のいずれを表しているかを判断し、対応するリアクションで Issue を分類してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- go
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100