Skip to content

Error checking in decoder #2

@gavv

Description

@gavv

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions