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
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.
The text was updated successfully, but these errors were encountered:
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.
Go standard library example for returning number of bytes:
https://golang.org/pkg/io/#Writer
Now, since #674, it is required that the entire input array be decoded,
or else it is an error. Now the number of bytes decoded doesn't make
much sense to return, since now it is known that it will always be the
length of the input.
Go standard library example for not returning number of bytes (decoding
everything):
https://golang.org/pkg/encoding/json/#Unmarshal
testVersion -> 4
Closes#683
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.
The text was updated successfully, but these errors were encountered: