Hacker News new | past | comments | ask | show | jobs | submit login

This is not a good example of how Go makes it easy to ignore errors (which it does in some cases, but not in that way). You had to acknowledge the dropped error syntactically.



A better example is the timeless:

    err := f1()
    if err != nil {..} // have to do this or compiler error

    err = f2()
    // oops, forgot to actually do anything about it!
Now, granted, `go vet` helps with this, but.. these kinds of things can be solved by the language proper in much better ways, and they should be type errors. Like rust's `Result` or Haskell's `Either`.

Edit: rust's result is especially nice with #[must_use]. This has saved my team from mistakes relatively frequently.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: