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

knqyf263/gost: db/redhat.go; 4 LoC

Open
#5,951 0 comments 2 reactions 0 assignees View on GitHub
experts: :+1: tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [knqyf263/gost](https://www.github.com/knqyf263/gost) at [db/redhat.go](https://github.com/knqyf263/gost/blob/3060e463e183010ebd1a9946718c819e914d408e/db/redhat.go#L22-L25)

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.

> function call which takes a reference to a at line 23 may start a goroutine

[Click here to see the code in its original context.](https://github.com/knqyf263/gost/blob/3060e463e183010ebd1a9946718c819e914d408e/db/redhat.go#L22-L25)

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

```go
for _, a := range all {
r.conn.Model(&a).Related(&a.Cvss3).Related(&a.Details).Related(&a.PackageState)
allCves = append(allCves, a)
}

```

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: 3060e463e183010ebd1a9946718c819e914d408e

Contributor guide

No contributing guide indexed for this repository

Research direction

Review db/redhat.go lines 22-25 at commit 3060e463e183010ebd1a9946718c819e914d408e, focusing on the range-loop reference passed to the chained calls. Use the linked classification guidance to decide whether the analyzer finding is a Bug, Mitigated, or Desirable Behavior, then leave the corresponding reaction; completion is the selected classification.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.