From 0d1e4a4cffafa976730c263bfc4f787d862f8661 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 18 Jan 2024 23:07:56 -0600 Subject: [PATCH] add main() as required by golang Signed-off-by: Jeff Carr --- action.go | 5 ++++- main.go | 5 ++++- stdin.go | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/action.go b/action.go index 9005514..8f73c03 100644 --- a/action.go +++ b/action.go @@ -79,9 +79,12 @@ func doAction(a widget.Action) { n.State.Pad = false case widget.Delete: log.Warn("doAction() TODO: Delete()") - // n.Delete() + n.DeleteNode() case widget.Move: log.Warn("doAction() TODO: Move()") + case widget.ToolkitClose: + log.Warn("doAction() toolkit closed. are the channels cleand up?") + return default: log.Log(ERROR, "doAction() Unknown =", a.ActionType, a.WidgetType) } diff --git a/main.go b/main.go index 4b2b53b..5f23297 100644 --- a/main.go +++ b/main.go @@ -19,6 +19,9 @@ func init() { me.myTree.PluginName = "nocui" me.myTree.ActionFromChannel = doAction - go simpleStdin() log.Log(INFO, "Init() END") } + +func main() { + simpleStdin() +} diff --git a/stdin.go b/stdin.go index 5695546..e0c2641 100644 --- a/stdin.go +++ b/stdin.go @@ -20,6 +20,7 @@ func simpleStdin() { log.Println("Stack trace:") debug.PrintStack() me.myTree.DoToolkitPanic() + return } }() scanner := bufio.NewScanner(os.Stdin)