This application implements a simple command-line calculator in Go. It allows users to perform basic arithmetic operations (+, -, *, /) on two numbers.
- Input Validation: Validates user input for numbers and operators to ensure calculations are performed accurately.
- Basic Operations: Supports addition, subtraction, multiplication, and division.
- Interactive Interface: Uses command-line interface (CLI) with prompts to guide users through operations.
Installation:
- Clone the repository.
- Ensure Go is installed on your machine.
- Go version used for development: go1.22.5 darwin/amd64
Running the Application:
- Navigate to the project directory.
- Run
go run calc.go
.
Operations:
- Follow on-screen prompts to enter numbers and select operators.
- Confirm to proceed with calculations.
- Option to reset or exit the calculator.
- Unit testing is recommended to ensure each function and method behaves as expected. Example test cases can be found in calc_test.go.
- Run
go test
.
- Contributions are welcome! Fork the repository and submit a pull request with your enhancements.
- Report bugs or suggest features by opening an issue.
This project is licensed under the MIT License. See the LICENSE.txt file for details.