4 ms·
It doesn't solve the problem then, because for non-pointer types we have to have multiple zero values: one for assignment and one for comparison.
by marcus_holmes 5y ago
It doesn't solve the problem then, because for non-pointer types we have to have multiple zero values: one for assignment and one for comparison.
- Joker_vD 5y agoTo be fair, it's not that much of a problem, and even then: "if result == _ { ... }" instead of "if result == MyPrettyStruct{} { ... }" is arguably more intent-revealing, as for "if number == _ { ... }", well, I guess the recommendation would be "just don't do that". Perhaps gofmt could even automatically replace it?