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

guangbochen/octopus-bak: test/util/node/get.go; 5 LoC

Open
#16,615 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [guangbochen/octopus-bak](https://www.github.com/guangbochen/octopus-bak) at [test/util/node/get.go](https://github.com/guangbochen/octopus-bak/blob/c014dce80be40bb9bc0fcfe1258f8d672a85a735/test/util/node/get.go#L21-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 node at line 22 may start a goroutine

[Click here to see the code in its original context.](https://github.com/guangbochen/octopus-bak/blob/c014dce80be40bb9bc0fcfe1258f8d672a85a735/test/util/node/get.go#L21-L25)

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

```go
for _, node := range list.Items {
if IsOnlyWorker(&node) {
workers = append(workers, node.Name)
}
}

```

Click here to show extra information the analyzer produced.

```
The following graphviz dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
digraph G {
"(IsOnlyWorker, 1)" -> {"(IsControlPlane, 1)";"(IsEtcd, 1)";}
"(IsControlPlane, 1)" -> {"(Set, 1)";}
"(New, 1)" -> {"(get, 1)";}
"(IsEtcd, 1)" -> {"(Set, 1)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(Set, 1)" -> {"(New, 1)";}
"(get, 1)" -> {"(SetTransportDefaults, 1)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(addConnIfNeeded, 3)" -> {}
}

```

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: c014dce80be40bb9bc0fcfe1258f8d672a85a735

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.