Skip to content

Proposal: validation API, which do not stop on first error #20

Description

@slsyy

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:

  1. Check error message about one value
  2. Fix one value
  3. Check error message about another one value
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions