diff --git a/interp/interp.go b/interp/interp.go index d0c8ff77a..60e6be381 100644 --- a/interp/interp.go +++ b/interp/interp.go @@ -132,7 +132,7 @@ type opt struct { stdout io.Writer // standard output stderr io.Writer // standard error - supressAssignmentResult bool + suppressAssignmentResult bool } // Interpreter contains global resources and state. @@ -247,7 +247,7 @@ type Options struct { Stdin io.Reader Stdout, Stderr io.Writer - SupressAssignmentResult bool + SuppressAssignmentResult bool } // New returns a new interpreter. @@ -299,7 +299,7 @@ func New(options Options) *Interpreter { // fastChan disables the cancellable version of channel operations in evalWithContext i.opt.fastChan, _ = strconv.ParseBool(os.Getenv("YAEGI_FAST_CHAN")) - i.opt.supressAssignmentResult = options.SupressAssignmentResult + i.opt.suppressAssignmentResult = options.SuppressAssignmentResult return &i } @@ -596,7 +596,7 @@ func (interp *Interpreter) eval(src, name string, inc bool) (res reflect.Value, interp.run(n, interp.frame) } - if interp.supressAssignmentResult { + if interp.suppressAssignmentResult { n := root for n.kind == blockStmt || n.kind == declStmt { n = n.lastChild() diff --git a/interp/interp_eval_test.go b/interp/interp_eval_test.go index 9153d361e..cada35aaa 100644 --- a/interp/interp_eval_test.go +++ b/interp/interp_eval_test.go @@ -1491,8 +1491,8 @@ func TestREPLDivision(t *testing.T) { } } -func TestEvalSupressAssignmentResult(t *testing.T) { - i := interp.New(interp.Options{SupressAssignmentResult: true}) +func TestEvalSuppressAssignmentResult(t *testing.T) { + i := interp.New(interp.Options{SuppressAssignmentResult: true}) runTests(t, i, []testCase{ {desc: "define", src: "a := 1", res: "{}"}, {desc: "define multiple", src: "a, b := 1, 2", res: "{}"},