Skip to content

Commit a0f9bc4

Browse files
committed
remove empty pkg, sort diagnostics
1 parent 3c2904c commit a0f9bc4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

coderd/httpapi/httperror/wsbuild.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"net/http"
8+
"sort"
89

910
"github.com/hashicorp/hcl/v2"
1011

@@ -35,7 +36,15 @@ func WriteWorkspaceBuildError(ctx context.Context, rw http.ResponseWriter, err e
3536
Validations: nil,
3637
}
3738

38-
for name, diag := range parameterErr.Parameter {
39+
// Sort the parameter names so that the order is consistent.
40+
sortedNames := make([]string, 0, len(parameterErr.Parameter))
41+
for name := range parameterErr.Parameter {
42+
sortedNames = append(sortedNames, name)
43+
}
44+
sort.Strings(sortedNames)
45+
46+
for _, name := range sortedNames {
47+
diag := parameterErr.Parameter[name]
3948
resp.Validations = append(resp.Validations, codersdk.ValidationError{
4049
Field: name,
4150
Detail: DiagnosticsErrorString(diag),

coderd/wsbuilder/wsbuilderror/builderror.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)