Comment

Comment by masklinn

> I do understand the reasoning (they don't want people committing poor quality code)

Not that this lint actually achieves that, or even prevents real errors. Go has the same, and it's so simplistic as to only be annoying. For instance not sure whether this fails in Zig but Go will allow this:

    v1, err := Foo()
    if err != nil {
        return nil, err
    }
    v2, err := Bar(v1)
    return v2, nil
Error of second call is never checked, but go has no issue with that, because it only tracks definitions per use.

    v1, err := Foo()
    v2, err := Bar(v1)
    if err != nil {
        return nil, err
    }
    return v2, nil
also works fine, despite probably sending complete nonsense to Bar, for the same reason.

But then it's an absolute pain in the ass every time you're fucking around and stop using a debug import or whatever.

parent masklinn 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton