[tools][cts] Fix 'merge' subcommand
Unlike reading from a nil map which produces a nil value, writing to a nil map results in a panic.
Fixed: dawn:2516
Change-Id: I1a0c60cec99693974a9ede717c380d901874c33d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/183880
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/tools/src/cmd/cts/merge/merge.go b/tools/src/cmd/cts/merge/merge.go
index b5803e6..a0e7d58 100644
--- a/tools/src/cmd/cts/merge/merge.go
+++ b/tools/src/cmd/cts/merge/merge.go
@@ -58,7 +58,7 @@
func (c *cmd) Run(ctx context.Context, cfg common.Config) error {
// Load each of the resultsByExecutionMode files and merge together
- var resultsByExecutionMode result.ResultsByExecutionMode
+ resultsByExecutionMode := make(result.ResultsByExecutionMode)
for _, path := range flag.Args() {
// Load results
r, err := result.Load(path)