console: prefer nil slices over zero-length slices (#19076)

This commit is contained in:
Matthew Halpern 2019-02-14 14:59:54 -08:00 committed by Péter Szilágyi
parent 2b75fa9d61
commit e26a119c9b
1 changed files with 1 additions and 1 deletions

View File

@ -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))
}