var magicNumber = 42
use(magicNumber)
could use a const instead. Using a real constant would signal to people and tools alike that the value of the variable intentionally never changes.
Labelled as needs-decision for now because I'm not sure how much people appreciate "technically better" suggestions.
On the surface it sounds good. How hard is it to implement? I'd be interested in running it over my code if you have some prototype.
@cespare should be easy enough to implement, and I'll definitely create a prototype before deciding on this issue. I'll let you know when there's something to test (but that will still be a while.)
As long as the check will take into account
const vs. var quirks, like the ones
in #833 and golang/go#28591, I'm all for it.
Another quirk to be mindful of: negative zero floating point.
Most helpful comment
@cespare should be easy enough to implement, and I'll definitely create a prototype before deciding on this issue. I'll let you know when there's something to test (but that will still be a while.)