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

Not preserve keys order #2

Open
rdxmaor opened this issue Jun 11, 2019 · 4 comments
Open

Not preserve keys order #2

rdxmaor opened this issue Jun 11, 2019 · 4 comments

Comments

@rdxmaor
Copy link

rdxmaor commented Jun 11, 2019

It seems like the tool can't preserve JSON keys order.

@squillace91
Copy link

was searching for that as well. any updates on this? btw thanks for the tool!

@yukithm
Copy link
Owner

yukithm commented Sep 11, 2020

It's hard to preserve keys order because of Golang constraint.
Golang's map structure type is non-ordered.

@mirusky
Copy link

mirusky commented Oct 13, 2020

I found a helpful package called orderedset it's helped me a lot with this problem, maybe you could see the source and apply the same logic here.

EDIT
And another called orderedmap who provides json encoding

@dolmen
Copy link
Contributor

dolmen commented Mar 11, 2021

See also my own package github.com/dolmen-go/jsonmap which provides an ordered map for JSON.

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

5 participants