Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error checking in decoder #2

Open
gavv opened this issue Apr 27, 2016 · 0 comments
Open

Error checking in decoder #2

gavv opened this issue Apr 27, 2016 · 0 comments

Comments

@gavv
Copy link

gavv commented Apr 27, 2016

Hello!

Currently there is no error checking in decoder, e.g. in DecodeToInt64():

idx = strings.IndexRune(e.encode, v)
...
c = int64(idx) * ...

strings.IndexRune() could return -1 here.

Would you accept a pull request that adds error checking?

What approach would you prefer?

  • panic() on error;
  • change return type from int64 to int64, error (this will break API);
  • add new function with int64, error return type?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant