aboutsummaryrefslogtreecommitdiff
path: root/core.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-24 00:25:10 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-24 00:25:10 +0100
commit07584da73461b69043451ebe48fcac226202492a (patch)
tree1f65f42f61bd10079ff369b039ff8dc0282f816d /core.go
parentbc1a7a271ba5a3f971e9dbed774b01b43af2642e (diff)
extract console, extract context
Diffstat (limited to 'core.go')
-rw-r--r--core.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/core.go b/core.go
index c3108b6..74355e5 100644
--- a/core.go
+++ b/core.go
@@ -55,10 +55,9 @@ func (c *Core) LoadFile(fname string) error {
}
// Run evaluates content of memory
-func (c *Core) Run(ctx context.Context) {
- ctx, cancel := context.WithCancel(ctx)
- c.tty = NewConsole(ctx)
+func (c *Core) Run(ctx context.Context, cancel context.CancelFunc, con Console) {
c.stop = cancel
+ c.tty = con
for {
select {
case <-ctx.Done():