envconfig
envconfig copied to clipboard
Feature Request: Continue processing after missing required values
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).
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.
Hi @teepark This issue seems to get solved. It should get closed.
It's not merged yet. And the PR is not resolved so... let's stick with it until then
@teepark any insights here? the PR seems really simple. Can it be merged?