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

Even Golang de facto suffers from this. I don't think I can name a time I saw someone check the return value of fmt.Print or log.Print. Not checking the return value still seems the the "right" thing to do.


This seems to be checking return values, which is a very unixy thing to do.

Most Go in the wild is doing way more than a typical *nix binary, so the use case differs.

If you want a resilient system, you don't die on print and log failures.


Usually the result of ignoring "disk full" or partial writes is not resilience but byzantine failure instead.


Because fmt and log print are not usually not used for this, if I were to do it properly I would use io.Copy() which everyone check the result.

Checking the result of log and print is very tedious and not useful most of the time.


I do. But then I’m writing a shell (like Bash/Fish/etc but more DevOps focused) so if I don’t handle all types of errors then the entire UX falls apart.


Indeed, first result and no error checking:

https://gobyexample.com/hello-world




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

Search: