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

Optional check for mispelled/unknown env vars #105

Closed
CAFxX opened this issue Feb 27, 2018 · 0 comments
Closed

Optional check for mispelled/unknown env vars #105

CAFxX opened this issue Feb 27, 2018 · 0 comments

Comments

@CAFxX
Copy link
Contributor

CAFxX commented Feb 27, 2018

It would be useful to prevent silent misconfigurations to have envconfig optionally be able to check if any of the environment variables currently set match the application prefix but is not in the set of allowed variable names.

type config struct {
  a int
  b int `ignored:"true"`
}

assuming the application prefix is MYAPP, the optional check should return the corresponding error if supplied with each env var:

MYAPP_A=1 # no error
MYAPP_B=1 # error: attempting to set ignored variable MYAPP_B
MYAPP_C=1 # error: attempting to set unknown variable MYAPP_C
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

2 participants