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

encoding/base64: Decode input errors are vague #10290

Closed
epelc opened this issue Mar 30, 2015 · 3 comments
Closed

encoding/base64: Decode input errors are vague #10290

epelc opened this issue Mar 30, 2015 · 3 comments
Labels
FrozenDueToAge v2 An incompatible library change

Comments

@epelc
Copy link

epelc commented Mar 30, 2015

encoding/base64 decoder input errors are very vague. They only give you a character number while if you look at the code there are comments stating the true reason for each error. Also perhaps if you don't want to return more specific errors you could add the character that was invalid instead of just the number.

Example from http://golang.org/src/encoding/base64/base64.go
image

You end up with an error message like the following

illegal base64 data at input byte 76

But it'd be a lot nicer if we knew why it was illegal.

Please let me know if I should put this on the forums. The issue guidelines don't say anything about requests/suggestions for improvements.

@bradfitz
Copy link
Contributor

Sorry, I don't think we can fix this at this point as a result of https://golang.org/doc/go1compat

And the CorruptInputError underlying type is just an int64, so there's no place to add extra information.

@epelc
Copy link
Author

epelc commented Mar 30, 2015

@bradfitz Thanks I forgot about go1 compatibility. Are you guys keeping track of these types of things for go2 anywhere?

@bradfitz bradfitz added the v2 An incompatible library change label Mar 30, 2015
@bradfitz
Copy link
Contributor

Just added the go2 label to this bug.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge v2 An incompatible library change
Projects
None yet
Development

No branches or pull requests

3 participants