Go: make use of multiple return values

This commit is contained in:
2018-10-10 20:59:35 +02:00
parent 2717cd569b
commit 2fe3c4753f
3 changed files with 136 additions and 168 deletions

View File

@@ -29,8 +29,7 @@ import (
)
func run(L *ell.Ell, program []ell.V) {
var result []ell.V
if !L.EvalBlock(program, nil, &result) {
if result, ok := L.EvalBlock(program, nil); !ok {
fmt.Printf("\x1b[31m%s: %s\x1b[0m\n", "runtime error", L.Error)
L.Error = ""
} else {