This is a simple Go-based application to manage ticket bookings for the "Go Conference." The app allows users to book conference tickets by providing their personal information and number of tickets, validates the input, and sends a confirmation email (simulated with a delay).
- Validate user input (name, email, ticket count)
- Book conference tickets
- Show remaining tickets
- Display the list of first names of all booked attendees
- Asynchronous ticket confirmation email simulation
Before running the application, make sure you have the following installed on your machine:
- Go (Golang)
- A working terminal or command prompt.
You can verify if Go is installed correctly by running the following command in your terminal:
go version
- Clone the repository to your local machine:
git clone https://github.com/arya-io/booking-app.git
- Navigate to the project directory:
cd booking-app
To run the application, execute the following command in the project directory:
go run main.go
Once the app is running, you'll be prompted to provide the following information:
- First Name: Your first name.
- Last Name: Your last name.
- Email: Your email address (must contain
@
). - Number of Tickets: The number of tickets you wish to book. The app will validate the input, book the tickets if valid, and simulate sending a confirmation email after a short delay.
Enter your first name: John
Enter your last name: Doe
Enter your email address: john.doe@example.com
Enter the number of tickets: 2
booking-app/ │
├── main.go # The main entry point for the application
├── helper.go # Contains helper functions for input validation
├── go.mod # Go module file for dependency management
└── README.md # Project documentation (this file)
- main.go: Handles the core logic of the application, including booking tickets, validating input, and sending confirmation emails.
- helper.go: Contains reusable functions to validate user input (name, email, and ticket count).
This project is licensed under the MIT License. See the LICENSE file for more details.