Skip to content

Commit

Permalink
Create main.go
Browse files Browse the repository at this point in the history
tried a little bit of go
  • Loading branch information
mursalatul authored Jan 24, 2025
1 parent ca5ca66 commit 9124d95
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions todo_ingo/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package main
import ("fmt")

func MainMenu() int {
for true {

fmt.Println("1. View All Task")
fmt.Println("2. Add Task")
fmt.Println("3. Delete Task")
var selected_option int = -1
fmt.Print("Option: ")
fmt.Scan(&selected_option)
if (selected_option != -1 && selected_option > 0 && selected_option < 4) {
return selected_option
}
}
return -1
}

var tasks = [] string {}
var tasks_status = [] bool {}

func showAllTasks() {
fmt.Println("Available Tasks are:")
for i := 1; i <= len(tasks); i++ {
if tasks_status[i] == true {
fmt.Printf("%d. %s[Comp1leted]", i, key)
} else {
fmt.Printf("%d. %s[Not Completed]", i, key)
}
i++
}
}

func addTasks() {

}

func main() {
fmt.Println("A GoLang Based To Do App------")
selected_option := MainMenu()
fmt.Println(selected_option)
if selected_option == 1 {
showAllTasks()
} else if selected_option == 2 {
addTasks()
} else if selected_option == 3 {
// delete task
}
}

0 comments on commit 9124d95

Please sign in to comment.