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

change struct tag name #46

Closed
wants to merge 3 commits into from

Conversation

ftKnox
Copy link
Contributor

@ftKnox ftKnox commented Jun 30, 2017

I have been using these changes in development and work fine. Ignore commit bbb73ad, I accidentally removed the json tag, but that still needs to be there as well. #44

@ewoutp
Copy link
Contributor

ewoutp commented Jul 4, 2017

Problem with this approach is that it does not work both ways (decoding & encoding).
In many place we use a standard json.Marshal/Unmarshal which does not take the arangodb tag into account.

@ewoutp
Copy link
Contributor

ewoutp commented Jul 4, 2017

If we add another tag (see problems above), it will be "use other tag if specified, otherwise use json tag" approach. With that it is not needed to duplicate all internally used tags.

@ftKnox
Copy link
Contributor Author

ftKnox commented Jul 4, 2017

Understood. So, I would put my vote in for supporting both a custom tag name and the standard json tag, since it would allow one to omit a struct value from the json encoding. (gorethink & mgo drivers work in this manner).

@ftKnox ftKnox closed this Jul 4, 2017
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.

2 participants