gordonklaus / ineffassign

Detect ineffectual assignments in Go code.
MIT License
394 stars 22 forks source link

false positive found #18

Closed ericlagergren closed 7 years ago

ericlagergren commented 7 years ago

Line https://github.com/ericlagergren/decimal/blob/522450d1e655d86ef13b0bfad42d090a0240ce03/decimal.go#L430 is marked as an ineffectual assign.

gordonklaus commented 7 years ago

The assignment to zm is indeed ineffectual, as zm is not thereafter used. The right hand side of an assignment happens before the assignment itself.

ericlagergren commented 7 years ago

fair enough, I actually fixed this not too long after I created the issue. (z.unscaled should be zm.)