4 ms·
There are two main reasons: 1. Many developers learn the print funcs before they really start paying attention to errors as return values, and so never think t
by reificator 8y ago
There are two main reasons:
1. Many developers learn the print funcs before they really start paying attention to errors as return values, and so never think to check what it returns.
2. If println is failing, things are going very wrong. It would probably be more ergonomic to just have it panic in most cases, because if it errors out then what are you honestly going to do to recover gracefully? Just let your surrounding infrastructure handle it, whether that's restarting the process, starting a new container somewhere else on the cluster, or whatever.
- skybrian 8y agoIf stdout is unavailable, should that really be fatal? Perhaps it should be considered an unusual equivalent to piping to /dev/null.
- reificator 8y agoWhich is the current practice of ignoring errors from `fmt.Println()`.