encoding/json: Add support for line breaks for base64 input to json.Unmarshal() #16578
Labels
Comments
Your input isn't valid JSON, though. As http://www.json.org/ says, strings cannot contain control characters -- and that's what the error message indicates. |
Ah quite. Then any implementation ought to be strictly optional. But that does seem rather evil then. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like to see
encoding/json
support email-style formatted base64 input. That is to say, I would like to see the following code not panic.With the current implementation, however, it does panic:
Why? It would make it easier to write readable unit tests of code that does a lot of marshaling and unmarshaling of custom data types.
I can't imagine it would be especially expensive to support this feature always, as I imagine simply filtering out all whitespace from the input stream would do it. But if it did prove to be expensive, supporting it only optionally some how would be reasonable for me as well.
The text was updated successfully, but these errors were encountered: