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

[]byte and []uint8 decoding fails #65

Closed
klauspost opened this issue Feb 5, 2015 · 1 comment
Closed

[]byte and []uint8 decoding fails #65

klauspost opened this issue Feb 5, 2015 · 1 comment

Comments

@klauspost
Copy link
Collaborator

Struct:

type ATbyte struct {
    X []byte
}

Fails with this content:

{"X":"VcELoXc4nIW9KPnUoVg="}

Message: "cannot unmarshal tok:string into Go value for offset=27 line=1 char=27"

@klauspost klauspost changed the title []byte and []uint8 encoding mismatch []byte and []uint8 decoding fails Feb 5, 2015
@pquerna
Copy link
Owner

pquerna commented Feb 5, 2015

encoding/json does do base64 decode of these fields here:
https://github.com/golang/go/blob/master/src/encoding/json/decode.go#L741-L752

(not documented)

@pquerna pquerna closed this as completed in 03a36e7 Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants