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

KaiSta/gopherlyzer-GoScout: benchmark/testcases/gocHashmap/mapInst/map.go; 15 LoC

Open
#6,905 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [KaiSta/gopherlyzer-GoScout](https://www.github.com/KaiSta/gopherlyzer-GoScout) at [benchmark/testcases/gocHashmap/mapInst/map.go](https://github.com/KaiSta/gopherlyzer-GoScout/blob/0f4a8a970c81b2157d0aa949fcc6626de459cf2f/benchmark/testcases/gocHashmap/mapInst/map.go#L414-L428)

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 e at line 415 may start a goroutine

[Click here to see the code in its original context.](https://github.com/KaiSta/gopherlyzer-GoScout/blob/0f4a8a970c81b2157d0aa949fcc6626de459cf2f/benchmark/testcases/gocHashmap/mapInst/map.go#L414-L428)

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

```go
for k, e := range read.m {
tracer.ReadAcc(&e, "testcases\\gocHashmap\\map\\map.go:333", myTIDCache)
v, ok := e.load()
tracer.WriteAcc(&v, "testcases\\gocHashmap\\map\\map.go:333", myTIDCache)
tracer.WriteAcc(&ok, "testcases\\gocHashmap\\map\\map.go:333", myTIDCache)
tracer.ReadAcc(&ok, "testcases\\gocHashmap\\map\\map.go:334", myTIDCache)
if !ok {
continue
}
tracer.ReadAcc(&k, "testcases\\gocHashmap\\map\\map.go:337", myTIDCache)
tracer.ReadAcc(&v, "testcases\\gocHashmap\\map\\map.go:337", myTIDCache)
if !f(k, v) {
break
}
}

```

Click here to show extra information the analyzer produced.

```
The following paths through the callgraph could lead to a goroutine:
(ReadAcc, 3) -> (informWatchDog, 0)

```

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: 0f4a8a970c81b2157d0aa949fcc6626de459cf2f

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.