Hacker News new | ask | show | jobs
by ben0x539 1644 days ago

    foo := someDefaultValue
    if someCondition {
        foo := someMoreSpecificValue
    }
Whoops, accidentally created a fresh, unused variable in the nested scope instead of changing the value of the original variable.

I do that frighteningly often.

1 comments

Seems to be more an indication that Go's variable declaration syntax is just not good.
Yeah, var/type name makes much more sense than ambiguity.