Closed tendervittles closed 5 years ago
So, if I understand correctly, you're saying you believe booleans are being treated differently, because in all three of your test cases, you have a 'short variable declaration' that explicitly initializes to the zero value for its type, followed by an assignment that sets the variable to a non-zero value, but in the case of a boolean, the initialization to its zero-value (false) is flagged as an ineffectual assignment, whereas the other two short declarations are treated as if they had been declared uninitialized (e.g. var s string
)?
@jvmatl
Thanks!
This tool has allowed me to slay many a bug today. Thank you!!!
I also noticed this inconsistent behavior.
I can init and update
s
andn
as expected, but I'm gettingineffectual assignment to b
.I am running go1.12.5.
Thanks!