Sort Validation warning and errors

Make the UI output consistent
This commit is contained in:
James Bardin 2017-03-03 09:46:08 -05:00
parent a2d78b62aa
commit 3e0af2abbb
1 changed files with 6 additions and 0 deletions

View File

@ -665,6 +665,12 @@ func (c *Context) Validate() ([]string, []error) {
// Return the result // Return the result
rerrs := multierror.Append(errs, walker.ValidationErrors...) rerrs := multierror.Append(errs, walker.ValidationErrors...)
sort.Strings(walker.ValidationWarnings)
sort.Slice(rerrs.Errors, func(i, j int) bool {
return rerrs.Errors[i].Error() < rerrs.Errors[j].Error()
})
return walker.ValidationWarnings, rerrs.Errors return walker.ValidationWarnings, rerrs.Errors
} }