Welcome to the Testing Golang Project Template! This project provides a structured and comprehensive template for testing APIs, covering basic CRUD operations for user management, including features like login and register.
- Introduction
- Features
- Getting Started
- Testing
In the realm of software development, integration testing plays a crucial role in ensuring the reliability and correctness of code. This project is dedicated to exploring and implementing Golang unit testing best practices, providing a foundation for creating resilient and maintainable applications.
- User Management: Implement user registration, login, and basic CRUD operations.
- API Testing: Comprehensive testing suite covering API endpoints.
- Environment Configuration: Utilize environment variables for configuration.
- Database Interaction: Interact with a MySQL database for user data storage.
- Structured Logging: Employ structured logging for better traceability.
- Dependency Management: Use Go modules for efficient dependency management.
- Consistent Coding Style: Follow a consistent coding style for better code readability.
- Documentation: Well-documented code and a README for easy understanding.
To get started with this project, follow these steps:
- Clone the repository:
git clone this repo link
cd your-repo
- Set up your environment variables:
Create a .env file based on .env.example and fill in the required configuration.
- Install dependencies:
go mod download
-
change your database configuration in db.go and setup tabels in package migrate
-
run migrate to migrate your tabel to database
make migrate
- run projects
make or make run
To run tests, run the following command
make test