-
Notifications
You must be signed in to change notification settings - Fork 51
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
keys are inconsistent with different backends #61
Comments
To go into a bit more detail on this: The confita README says:
and then, later on:
This description is true for all the backends except the file backend, which instead unmarshals the file data directly into the struct, meaning that the config tags are entirely ignored. This has a few implications:
This issue won't be trivial to fix in a backward compatible fashion, as making field names consistent would break some existing behaviour. Here is some code that demonstrates some of the issues: https://play.golang.org/p/UJcNsbP6NOc |
Good catch @rogpeppe. As you said it will be complicated to fix that without breaking the actual API. Do you have any idea in mind? |
I would like to work on this issue, any guidance or directions? |
@rmcodor we're actually about to branch the current codebase into a V0 branch and work on a major restructuring should make things more consistent. I'd hold off before diving into anything too big. Are you looking to work on it because it's an issue that affects you, or are you just looking for things to do? If it's the latter we can chat about that too. |
When using the env backend, then the only keys considered will be those with
config:
field tags. However, if you're using a file backend, then the entire struct is unmarshaled from the source, and all fields will be considered, even those without a config tag.So it's possible there are some fields which are configurable only with the file backend and not with the env backend.
I think that probably that any keys that don't specify the
config:
tag should be ignored so backends are more consistent.The text was updated successfully, but these errors were encountered: