go-env
go-env copied to clipboard
Proposal: validation API, which do not stop on first error
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