Skip to content
/ GoDo Public

This is a todo cli app made using go and clean architecture.

Notifications You must be signed in to change notification settings

Melat369/GoDo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grocery List Organizer

Description

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.

Skills Covered:

  • 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.

Features

  • 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).

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/Melat369/GoDo.git
    cd GoDo
  2. Install Go if you don't have it installed yet. You can download Go from the official website: Go Downloads.

  3. Initialize and run the Go application:

 go run cmd/main.go

Usage

Commands:

  • 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 and Sample Tests

Project Structure

Project Structure

Sample Tests

Sample Test

Contributors

The following people have contributed to this project:

Course Instructor


About

This is a todo cli app made using go and clean architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •