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

How to decode JSON from []byte? #76

Open
rushkii opened this issue Mar 20, 2022 · 3 comments
Open

How to decode JSON from []byte? #76

rushkii opened this issue Mar 20, 2022 · 3 comments

Comments

@rushkii
Copy link

rushkii commented Mar 20, 2022

Hello, I want to decode JSON response from fasthttp.Response Body() []byte, but I don't know how to do it.
I currently using encoding/json decoder.

@G2G2G2G
Copy link

G2G2G2G commented Apr 29, 2022

before asking questions on anything, you should at the very least read the readme
https://github.com/valyala/fastjson#usage
instead of Parse.. you can use ParseBytes.. which there are also plenty of posts about in examples etc

@rushkii
Copy link
Author

rushkii commented Apr 29, 2022

before asking questions on anything, you should at the very least read the readme https://github.com/valyala/fastjson#usage instead of Parse.. you can use ParseBytes.. which there are also plenty of posts about in examples etc

Hmmm oke, but I think it doesn't support parsing to a struct?

@G2G2G2G
Copy link

G2G2G2G commented Apr 29, 2022

which is why fastjson and other json libraries aren't slow as hell like default marshaller.. just use that if you use a struct. derp

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