You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of calling panic(), the Init, ReadTable and WriteTable functions in table.go should return the error. Using LXRHash from a larger program is made more difficult because of these panic() calls.
I'm happy to submit a PR. I thought I should open this discussion to make sure that others agree.
The text was updated successfully, but these errors were encountered:
We already have a lot of apps using the existing api. If we were to add an error return, it would break those apps when they update.
If we remove the panic, I'd like to maintain the old interface to the library, and add the additional apis for the optional return with a comment deprecating the old and allowing for time to update.
E.g:
// Deprecated: Panics on error instead of returning an error. Please use "InitTable()"
func Init(...) {
err := InitTable(...)
if err != nil {
panic(err)
}
}
func InitTable(...) err {
...
}
Instead of calling
panic()
, theInit
,ReadTable
andWriteTable
functions in table.go should return theerror
. Using LXRHash from a larger program is made more difficult because of thesepanic()
calls.I'm happy to submit a PR. I thought I should open this discussion to make sure that others agree.
The text was updated successfully, but these errors were encountered: