kalexmills / rangeloop-test-repo

Test repository
0 stars 0 forks source link

dbehnke/influxdb-gb: vendor/src/golang.org/x/crypto/ssh/kex_test.go; 27 LoC #4354

Open githubvet opened 3 years ago

githubvet commented 3 years ago

Found a possible issue in dbehnke/influxdb-gb at vendor/src/golang.org/x/crypto/ssh/kex_test.go

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.

range-loop variable kex used in defer or goroutine at line 28

Click here to see the code in its original context.

Click here to show the 27 line(s) of Go which triggered the analyzer. ```go for name, kex := range kexAlgoMap { a, b := memPipe() s := make(chan kexResultErr, 1) c := make(chan kexResultErr, 1) var magics handshakeMagics go func() { r, e := kex.Client(a, rand.Reader, &magics) c <- kexResultErr{r, e} }() go func() { r, e := kex.Server(b, rand.Reader, &magics, testSigners["ecdsa"]) s <- kexResultErr{r, e} }() clientRes := <-c serverRes := <-s if clientRes.err != nil { t.Errorf("client: %v", clientRes.err) } if serverRes.err != nil { t.Errorf("server: %v", serverRes.err) } if !reflect.DeepEqual(clientRes.result, serverRes.result) { t.Errorf("kex %q: mismatch %#v, %#v", name, clientRes.result, serverRes.result) } } ```

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 for more information.

commit ID: 4ee5f88c4f5233e3b98d7885e1347582aacdff70