Perfect! Let’s make your README look professional, visually clean, and GitHub-ready. I’ll add tables, clear sections, and a roadmap so anyone can read and implement enhancements easily.
Here’s the upgraded version:
A simple command-line To-Do List application written in Go.
Manage your tasks directly from the terminal with ease — add, list, start, complete, and delete tasks. Uses enums for Priority and Status to keep tasks structured and readable.
| Feature | Description |
|---|---|
| Add Task | add <description> [-p priority] → Add a new task with optional priority (low, medium, high) |
| List Tasks | list [status] → Show all tasks or filter by status (pending, started, completed) |
| Start Task | start <task-id> → Mark a task as started |
| Complete Task | done <task-id> → Mark a task as completed |
| Delete Task | delete <task-id> → Remove a task from the list |
| Automatic ID | Each task is assigned a unique ID automatically |
Run the program and enter commands in the terminal:
> add Buy groceries -p high
Task added! ID: 1 | Buy groceries | High
> list pending
ID Status Priority Description
1 Pending High Buy groceries
> start 1
Task 1 marked as Started.
> done 1
Task 1 marked as Completed.
> delete 1
Task 1 deleted successfully.
> exit
Goodbye!These functions can be added to improve maintainability and features:
| Function | Description |
|---|---|
findTaskByID(tasks []Task, id int) (int, *Task) |
Search for a task by ID and return a reference for easy updates (used in start, done, delete) |
listTasks(tasks []Task, filter string) |
Move task listing logic into a function with optional status filtering |
updateTask(tasks *[]Task, id int, newDescription string, newPriority Priority) |
Edit a task’s description or priority after creation |
clearCompleted(tasks *[]Task) |
Remove all tasks marked as Completed from the list |
showHelp() |
Display all available commands and usage instructions |
| Persistence | Implement saveTasksToFile(filename string) and loadTasksFromFile(filename string) using JSON to retain tasks between sessions |
- Refactor your CLI using helper functions like
findTaskByIDandlistTasksfor cleaner code. - Implement
updateTaskto allow editing task descriptions and priorities. - Add
clearCompletedto clean up completed tasks in bulk. - Implement file persistence to save and load tasks between sessions.
- Enhance CLI with priority filtering in the list command.
- Add a
helpcommand to make the tool user-friendly for beginners.
If you implement the suggested enhancements:
- Test your code thoroughly for edge cases (invalid IDs, empty task list, missing arguments).
- Share your updated code by sending it to:
m.arshad.baloch2004@gmail.com
- The project is fully in-memory, so tasks are lost when the program exits unless file persistence is added.
- Priority defaults to
Mediumif not specified. - Status transitions:
Pending → Started → Completed.