Closed SandyWalsh closed 3 years ago
Sorry for the n00b questions ... been having fun playing with this library.
I'm doing this
type Foo { Things []string } ptrs := []*Foo{} err = ev.Define("foo", ptrs) if err != nil { return nil, err } _, err = vm.Execute(ev, nil, script) if err != nil { return nil, err } outi, err := ev.Get("foo") if err != nil { return nil, err }
and in my script I'm (effectively) doing
foo[0].Things = foo[0].Things + "new thing"
But I'm not seeing "new thing" coming out. Should I be using some sort of append()-like call?
append()
Also, the Execute() call has a return value ... what's in it? And how do I set it? Don't see anything in the docs about it.
Execute()
nm ... figured it out.
Sorry for the n00b questions ... been having fun playing with this library.
I'm doing this
and in my script I'm (effectively) doing
But I'm not seeing "new thing" coming out. Should I be using some sort of
append()
-like call?Also, the
Execute()
call has a return value ... what's in it? And how do I set it? Don't see anything in the docs about it.