|
|
|
|
|
by ithkuil
2933 days ago
|
|
If want (and if it makes sense) you can use panics as a control flow mechanism to quickly bubble up errors inside your implementations. See an example in the standard library itself: https://golang.org/src/encoding/json/encode.go, line 295 What's frowned upon is leaking this out of your package's interface/contract. |
|
Java/Python encourage the use of exceptions as returning error conditions, rather than return error codes.