From e26a119c9b83e816a8ce9b0afdd6f2c82e61062d Mon Sep 17 00:00:00 2001 From: Matthew Halpern Date: Thu, 14 Feb 2019 14:59:54 -0800 Subject: [PATCH] console: prefer nil slices over zero-length slices (#19076) --- console/console.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/console.go b/console/console.go index 222ac3b52d..50196d7f48 100644 --- a/console/console.go +++ b/console/console.go @@ -236,7 +236,7 @@ func (c *Console) clearHistory() { // consoleOutput is an override for the console.log and console.error methods to // stream the output into the configured output stream instead of stdout. func (c *Console) consoleOutput(call otto.FunctionCall) otto.Value { - output := []string{} + var output []string for _, argument := range call.ArgumentList { output = append(output, fmt.Sprintf("%v", argument)) }