This is a hotel reservation system program written in Go.
- Room Management: The hotel has five rooms.
- User Menu: Allows users to:
- Reserve rooms
- View room details
- Cancel reservations
- Concurrency Handling: Utilizes goroutines to periodically check for vacant rooms and ensure thread-safe operations.
-
Navigate to the Project Folder:
cd path/to/your/project
-
Initialize Dependencies:
go mod tidy
-
Run the Program:
go run main.go
-
Switch to the hotel folder inside the project:
cd hotel
-
To test the functionality of the program, including concurrency, use the following commands:
go test -v
-
For detecting race conditions in your tests, run:
go test -race