The Grocery List Organizer is a simple command-line tool that helps users manage their grocery items. Users can:
- Add grocery.
- List grocery
This project demonstrates the use of Go slices, maps, and error handling as covered in Lessons 2.1, 2.3, and 2.4 of the course. It utilizes maps to organize grocery items by category, slice manipulation for adding and deleting items, and includes error handling for invalid entries or non-existent items.
- Arrays/Slices: Managing grocery items using slices for dynamic data storage.
- Maps: Using maps to categorize grocery items for efficient look-up and organization.
- Error Handling: Handling errors for invalid user inputs and attempts to delete non-existent items.
- Bonus Feature: Sorting items alphabetically within each category.
- Add grocery: Users can add grocery groceries to specific categories.
- List grocery: Users can list all groceries in a given category.
- Delete groceries: Users can delete groceries by name and category.
- Error handling: Ensures only valid entries are processed, and informs users if something goes wrong (e.g., deleting an item that doesn't exist).
- Bonus: Groceries in each category are sorted alphabetically (optional feature).
-
Clone this repository to your local machine:
git clone https://github.com/Melat369/GoDo.git cd GoDo -
Install Go if you don't have it installed yet. You can download Go from the official website: Go Downloads.
-
Initialize and run the Go application:
go run cmd/main.go-
Add Item: Add a new item to a category.
Example:
Choose an action: add, complete, delete, list, or exit -> add Enter grocery title: Banana Grocery added with ID 1
-
List groceries: list groceries.
Example:
Choose an action: add, complete, delete, list, or exit -> add Enter grocery title: jinjer Enter grocery title: Tea Grocery added with ID 2
Project Structure
Sample Tests
The following people have contributed to this project:
-
Melat Tesfaye
GitHub: Melat Tesfaye
Email: melat.tesfaye.123456@gmail.com -
Getinet Amare
GitHub: GetinetAmareGitHub
Email: getinet.neu@gmail.com -
Yohans Samuel
GitHub: YohansSamuelGitHub
Email: YohansSamuel@gmail.com
- Dawit Elias Gebremariam
Email: dawiteliaskassaye@gmail.com
LinkedIn: Dawit Elias LinkedIn

