Closed vvdvortsova closed 3 years ago
func (cid CID) Parse(e Entity) CID {
if cid == 0 {
return e.Init()
}
return cid
}
Reopen with an actual panic if found.
To clarify: cid
is not dereferenced, as the method has a value receiver, not a pointer receiver. The method also expects to receive a 0
and its whole job is built around accepting that 0
.
You are right. I agree with you. Sorry. It's FP. On your case we'll fix it.
Hello This warning found with the Svace. [dereference] '0' is passed to function 'entities.NewMoving' as 7th parameter at core.go:73 https://github.com/oakmound/oak/blob/49338760bf9aa81e21e30dbe8ece44fc43e61fa5/examples/pong/main.go#L74 https://github.com/oakmound/oak/blob/49338760bf9aa81e21e30dbe8ece44fc43e61fa5/entities/moving.go#L17 cid is dereferenced here. at moving.go:19 https://github.com/oakmound/oak/blob/49338760bf9aa81e21e30dbe8ece44fc43e61fa5/entities/moving.go#L19 It may lead to panic.