Open igoradamenko opened 4 years ago
Seems like it was written as such for consistency. I had the same thought that this might not be needed though.
It was likely done just to preserve alignment or for consistency... but I agree that it just makes the code more confusing. It looks like it's needed, but it's not, really.
Thanks! I've created #1034.
Context: https://tour.golang.org/flowcontrol/10
Hey there!
I'm probably getting this wrong, but why is the
+ 0
in this code?I thought it might do some type coercion or so, and otherwise the first case-branch wouldn't match, but when I changed the tested weekday and removed
+ 0
it worked as expected: