This project is a simple command-line interface (CLI) application for managing a todo list, created as a learning exercise to familiarize myself with the Go programming language. The application demonstrates basic CRUD (Create, Read, Update, Delete) operations on a list of tasks, with data stored in a JSON file.
This project is written in Go (Golang), a statically typed, compiled programming language designed for simplicity and efficiency. For more information about Go, you can visit the Go Programming Language website.
The primary goal of this project was to gain hands-on experience with Go by building a practical application. This todo app serves as a straightforward example of how to use Go for file handling, command-line arguments, and basic data manipulation.
- Add a New Todo: Add new tasks to your todo list.
- Edit an Existing Todo: Update the title of a task by specifying its index.
- Delete a Todo: Remove a task from the list by its index.
- Toggle Task Completion: Mark a task as completed or not completed.
- List All Todos: Display all tasks in a formatted table.
Tasks are saved in a JSON file, which allows for easy persistence and retrieval of the todo list between application runs.
The application uses command-line flags to execute various operations. Users can interact with the app via terminal commands to manage their tasks.
main.go
: Contains the core logic for managing todos, including theTodo
struct and methods for adding, editing, deleting, toggling, and listing tasks.storage.go
: Manages saving and loading data to/from a JSON file using theStorage
struct.cmdflags.go
: Handles parsing command-line flags and executing corresponding actions using theCmdFlags
struct.
- Clone the Repository:
git clone https://github.com/amiraa205/A-CLI-Todo-App-in-Go.git cd A-CLI-Todo-App-in-Go