Skip to content

variable-length-quantity: I don't think returning number of bytes decoded is necessary #683

Closed
@petertseng

Description

@petertseng

Since it was introduced in #322, the decode function returns the number of bytes decoded. The creator of the exercise mentioned that it was to be consistent with the standard library's API. I am not sure right now, but I guess it would be something similar to https://golang.org/pkg/io/#Writer or something?

Now, since #674, it is required that the entire input array be decoded, or else it is an error. I would say now that the number of bytes to decode doesn't make much sense to return, since now it is known that it will always be the length of the input array. If you want an standard library example, https://golang.org/pkg/encoding/json/#Unmarshal doesn't return number of bytes decoded.

I will probably do this myself in a little over 24 hours but can't now, so it's a reminder for me to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions