From d3056fc0c93292c516b60cfc7294862831ebbb45 Mon Sep 17 00:00:00 2001 From: oscarzhou Date: Mon, 26 Dec 2022 20:54:17 +1300 Subject: [PATCH] task: add exit task as the default task --- go/main.go | 2 -- go/tasks/tasker.go | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/go/main.go b/go/main.go index ec094d9..51c02ce 100644 --- a/go/main.go +++ b/go/main.go @@ -20,8 +20,6 @@ func main() { tasks.NewCurlLookupTask(), tasks.NewCodeSecurityScanTask(), tasks.NewListDevToolCommandTask(config), - - tasks.NewExitTask(), } tasks.ListCommandMenu(taskItems, "Which repository of action do you want operate:") diff --git a/go/tasks/tasker.go b/go/tasks/tasker.go index 154f696..ce5be30 100644 --- a/go/tasks/tasker.go +++ b/go/tasks/tasker.go @@ -14,6 +14,7 @@ type Tasker interface { // ListCommandMenu iterates task items to display them // on the screen as the menu options func ListCommandMenu(taskItems []Tasker, menuDesp string) error { + taskItems = append(taskItems, NewExitTask()) for { printMainMenu := func() { taskNames := []string{}