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

Support types other than string in map keys #4

Merged
merged 1 commit into from
Dec 13, 2019
Merged

Conversation

kbrackbill
Copy link

Sheriff currently only supports marshalling maps with string keys. This is a pretty significant limitation compared to the built-in json package.
Unfortunately, the built-in json package doesn't export its functionality for dealing with map keys, but at least it's fairly small. I've copied the relevant function from the go source and wired it in.

Debugging this problem was made more difficult by the fact that we generally don't check for errors from json.Marshal in gonfalon. This was fine when we were using the built-in one as we understood the small set of errors it could throw, but now that we're using this library we should probably check everywhere.

@kbrackbill
Copy link
Author

Going to merge this for now to get more 👀 in the corresponding gonfalon review.

@kbrackbill kbrackbill merged commit 3aa2169 into master Dec 13, 2019
@kbrackbill kbrackbill deleted the kbrack/map-keys branch December 13, 2019 19:20
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

Successfully merging this pull request may close these issues.

1 participant