4 ms·
Avoiding error checking against a properly formatted constant is not avoiding error checking. I cannot follow your argument.
by rakyll 10y ago
Avoiding error checking against a properly formatted constant is not avoiding error checking. I cannot follow your argument.
- ben_jones 10y agoSorry, I guess I'm not really making one. If anything I'm commenting that (IMO) explicit error handling isn't as explicit as people thing it is. There are internal errors induced by panic() that are really inconvenient.
- mixedCase 10y agoPanics are supposed to be launched on an "end all work on this; code path is FUBAR". On a web server that usually means dropping the connection, logging everything and firing an automated e-mail to the dev team to notify there's a bug in the code that needs to be fixed. All other error conditions are expected and handled. That's what Go's error handling philosophy is all about.
- jimjimjim 10y agopanic should be a "the world is ending" sort of operation.