github-vet / github-vet/rangeloop-pointer-findings
praparn/kubernetes_201904: WorkShop_2.5_Kubernetes_RealWorld/ingress-nginx/internal/ingress/types_equals.go; 6 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [praparn/kubernetes_201904](https://www.github.com/praparn/kubernetes_201904) at [WorkShop_2.5_Kubernetes_RealWorld/ingress-nginx/internal/ingress/types_equals.go](https://github.com/praparn/kubernetes_201904/blob/92c6c826b9a75a27925c13dcf921100d54c3e015/WorkShop_2.5_Kubernetes_RealWorld/ingress-nginx/internal/ingress/types_equals.go#L77-L82)
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 udp2 at line 78 may start a goroutine
[Click here to see the code in its original context.](https://github.com/praparn/kubernetes_201904/blob/92c6c826b9a75a27925c13dcf921100d54c3e015/WorkShop_2.5_Kubernetes_RealWorld/ingress-nginx/internal/ingress/types_equals.go#L77-L82)
Click here to show the 6 line(s) of Go which triggered the analyzer.
```go
for _, udp2 := range c2.UDPEndpoints {
if (&udp1).Equal(&udp2) {
found = true
break
}
}
```
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 {
"(append, 1)" -> {}
"(dial, 2)" -> {"(NewServerConn, 2)";"(NewClientConn, 3)";}
"(Do, 3)" -> {}
"(serverHandshake, 1)" -> {"(newServerTransport, 4)";}
"(tryUpgrade, 2)" -> {}
"(newClientTransport, 6)" -> {}
"(parse, 1)" -> {"(New, 1)";"(Parse, 1)";"(Push, 1)";"(copy, 2)";"(append, 1)";}
"(NewLease, 1)" -> {}
"(Set, 2)" -> {"(Do, 3)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(newServerTransport, 4)" -> {}
"(applyRequest, 1)" -> {"(Copy, 2)";}
"(RoundTrip, 1)" -> {"(awaitOpenSlotForRequest, 1)";}
"(Get, 1)" -> {"(Get, 2)";}
"(newClient, 1)" -> {"(dial, 2)";"(NewLease, 1)";}
"(Start, 1)" -> {}
"(Set, 1)" -> {"(Add, 2)";"(New, 2)";"(Parse, 1)";"(New, 1)";}
"(New, 2)" -> {"(Start, 1)";}
"(Push, 1)" -> {"(Set, 2)";}
"(apply, 2)" -> {"(applyRequest, 1)";}
"(Copy, 2)" -> {"(ServeHTTP, 2)";}
"(get, 1)" -> {"(SetTransportDefaults, 1)";"(Get, 1)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(parseExtension, 1)" -> {"(copy, 2)";}
"(Compare, 1)" -> {"(parse, 2)";}
"(Parse, 1)" -> {"(Set, 2)";}
"(ServeHTTP, 2)" -> {"(tryUpgrade, 2)";"(tryUpgrade, 7)";}
"(copy, 2)" -> {"(findObject, 2)";"(get, 1)";}
"(handle, 2)" -> {"(ServeHTTP, 2)";}
"(NewClientConn, 3)" -> {"(clientHandshake, 2)";}
"(Equal, 1)" -> {"(Compare, 1)";}
"(Add, 2)" -> {"(Do, 2)";}
"(Do, 2)" -> {"(RoundTrip, 1)";}
"(awaitOpenSlotForRequest, 1)" -> {}
"(parseTag, 1)" -> {"(copy, 2)";}
"(New, 1)" -> {"(get, 1)";"(newClient, 1)";"(Start, 1)";"(New, 2)";"(apply, 2)";"(Parse, 1)";"(Merge, 1)";}
"(Merge, 1)" -> {"(Set, 2)";}
"(parseExtensions, 1)" -> {"(parseExtension, 1)";}
"(findObject, 2)" -> {"(get, 1)";}
"(NewServerConn, 2)" -> {"(serverHandshake, 1)";}
"(tryUpgrade, 7)" -> {}
"(parse, 2)" -> {"(Set, 1)";"(parseTag, 1)";"(parseExtensions, 1)";"(parse, 1)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(addConnIfNeeded, 3)" -> {}
"(Get, 2)" -> {"(handle, 2)";}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
}
```
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: 92c6c826b9a75a27925c13dcf921100d54c3e015
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.