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

Feature Request: Continue processing after missing required values #143

Open
hbobenicio opened this issue Mar 13, 2019 · 4 comments
Open

Comments

@hbobenicio
Copy link

hbobenicio commented Mar 13, 2019

With this spec...

type spec struct {
	Foo string `required:"true"`
	Bar string `required:"true"`
}

This process...

var s spec
err := envconfig.Process("myapp", &s)
if err != nil {
	log.Fatalln(err.Error())
}

...stops processing right after the first missing required variable is detected

2019/03/13 10:42:54 required key MYAPP_FOO missing value

Feature Request

It would be really useful in some cases (most? all of them?) just to keep processing, in order to detect all missing required variables.

Motivation

Just imagine an app that have a bunch of required variables that won't start because a missing required variable. Then you fix that one that is missing, then run the app again... then fix another one, then run it again... over and over, until you finally realize all the ones that are missing on your runtime configuration (just after some laborious run-and-fix work).

@teepark
Copy link
Collaborator

teepark commented May 24, 2019

I agree that would be a significant DX improvement. If you want to backport the change in ndrewnee/envconfig#3 I can see merging that PR.

@TonyPythoneer
Copy link

Hi @teepark
This issue seems to get solved. It should get closed.

@hbobenicio
Copy link
Author

hbobenicio commented Dec 16, 2019

It's not merged yet. And the PR is not resolved so... let's stick with it until then

@hbobenicio
Copy link
Author

@teepark any insights here? the PR seems really simple. Can it be merged?

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