kalexmills / rangeloop-test-repo

Test repository
0 stars 0 forks source link

dachengzao/golangBBS: vendor/github.com/ugorji/go/codec/codec_test.go; 32 LoC #4311

Open githubvet opened 3 years ago

githubvet commented 3 years ago

Found a possible issue in dachengzao/golangBBS at vendor/github.com/ugorji/go/codec/codec_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.

function call which takes a reference to r at line 1698 may start a goroutine

Click here to see the code in its original context.

Click here to show the 32 line(s) of Go which triggered the analyzer. ```go for _, r := range []RawExt{ {Tag: 99, Value: "9999", Data: []byte("9999")}, } { e := NewEncoderBytes(&b, h) e.MustEncode(&r) // fmt.Printf(">>>> rawext: isnil? %v, %d - %v\n", b == nil, len(b), b) d := NewDecoderBytes(b, h) d.MustDecode(&v) var r2 = r switch { case isJson: r2.Tag = 0 r2.Data = nil case isCbor: r2.Data = nil default: r2.Value = nil } testDeepEqualErr(v, r2, t, "rawext-default") // switch h.(type) { // case *JsonHandle: // testDeepEqualErr(r.Value, v, t, "rawext-json") // default: // var r2 = r // if isValuer { // r2.Data = nil // } else { // r2.Value = nil // } // testDeepEqualErr(v, r2, t, "rawext-default") // } } ```

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: 2d9d122019c9d0439d9e582f2739f374e117f788