Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Alright, that makes more sense to me.

Do you know if they intend to fix the need for phoney code paths? It seems odd that a language with nice support for first class functions and closures can't acknowledge when "if ... else ..." has complete flow coverage.



> Do you know if they intend to fix the need for phoney code paths?

It's a purposeful restriction imposed by the Go compiler, but not by the Go language specification.

And I think the idea is to encourage explicitness, and force cases like these:

    if cond {
        return ...
    } else {
        return ...
    }
Into a simpler:

    if cond {
        return ...
    }
    return ...
Reasonable people can disagree over whether this is a Good Thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: