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

Use var for attrPrefix and contentPrefix #26

Open
henripqt opened this issue Sep 1, 2020 · 2 comments
Open

Use var for attrPrefix and contentPrefix #26

henripqt opened this issue Sep 1, 2020 · 2 comments

Comments

@henripqt
Copy link

henripqt commented Sep 1, 2020

As of now we cannot remove attrPrefix and contentPrefix by setting them to a blank string as the decoder checks on that and defaults to their const attrPrefix and contentPrefix

In our case we'd like not to use any prefixes onto either of the extracted values. A simple fix could be to define attrPrefix and contentPrefix as var instead of const in order to allow overriding them using ldflags

@M4x3e3e
Copy link

M4x3e3e commented Nov 9, 2020

same issue here

@NikolayUvarov
Copy link

NikolayUvarov commented Nov 11, 2020

Cannot rid of "minuses" before inner parameter names in a simple way. Conversion to parameters that has different name (with minus prefix) is an obstacle.

update:
The issue mostly due to lack of dockumentation.
Here as I have solved the prefix problem:

json, err := xj.Convert(xml, xj.WithAttrPrefix(""))

It seems reasonable than by default there were no prefixes and user should add them conciously.

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

3 participants