Proposal: validation API, which do not stop on first error
Opened this issue · 0 comments
slsyy commented
Currently Unmarshal
return error as soon as it is possible, which means that in the case of invalid env configuration we need to check it in a loop:
- Check error message about one value
- Fix one value
- Check error message about another one value
GOTO 2
I propose new alternatives for UnmarshalFromEnviron
and Unmarshal
to the API, which will return error of that type:
type ErrValidation struct {
Errors map[string]error
}
So I know exactly what is wrong in the configuration