From 3e0af2abbb10a6ea72254baff67cc65432c04732 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 3 Mar 2017 09:46:08 -0500 Subject: [PATCH] Sort Validation warning and errors Make the UI output consistent --- terraform/context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/terraform/context.go b/terraform/context.go index 06eef4300c..3c4e4b62ed 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -665,6 +665,12 @@ func (c *Context) Validate() ([]string, []error) { // Return the result 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 }