4 ms·
not even go developers find the error handling adequate. Since if it was then slice acces would return an error rather than panic. a,err:=slice[i] ...
by Bomaz 5y ago
not even go developers find the error handling adequate. Since if it was then slice acces would return an error rather than panic.
a,err:=slice[i]
...
- gnubison 5y agoDo you also believe that the / operator should return two values, a “primary” result and an error value?
- Bomaz 5y agoif golang error handling is a good way of handling errors that should be the correct implementation
- philosopher1234 5y agoYour thinking is too black and white.
- iainmerrick 5y agoGo isn’t alone there. Swift arrays also raise fatalError on out-of-bounds access by default, which seems incredible in an otherwise “safe” language. It’s easy to write your own accessor that returns an optional, but why isn’t that the default??