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

Investigate some potential edge cases around the 'gcfg:"extra_values"' functionality. #8

Open
tiagovtristao opened this issue Nov 27, 2021 · 0 comments

Comments

@tiagovtristao
Copy link

Recent functionality was added around the gcfg:"extra_values" tag which allows extra fields set on the configuration file to be read and set, even if they aren't statically defined.

There a couple of things worth nothing with the gcfg:"extra_values" tag that are worth investigating:

  • The original library already supported the gcfg tag which allowed for the variable name in the configuration file to differ from the actual Go struct field. ie. "BuildFilename string gcfg:"anything"" would map the anything variable in the configuration file to the BuildFilename struct field. This means that gcfg:"extra_values" is also a valid variable rename case.
  • If a field is set as "MyField map[string]string gcfg:"extra_values"", what happens if there's a corresponding myfield variable set in the configuration file?

These are edge cases that I bumped into when working on separate tickets.

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

1 participant