{
"packets": [250, 500, 1000, 2000, 5000]
}
[
250,
500,
1000,
2000,
5000
]
{
"items": 251
}
{
"item": 251,
"packets": {
"500": 1
}
}
Before running any of the Makefile targets, make sure you have the following prerequisites:
- Go (Golang) installed on your system.
- Docker and Docker Compose (if you intend to use Docker-related targets).
- The project's directory structure and necessary configuration files are set up as expected.
This target displays a list of available Makefile targets and their descriptions.
make help
This target builds a production binary file of application. It uses the create-env
target to ensure the necessary environment files are present.
make release
This target builds a development binary file of application. Like release
, it also relies on the create-env
target.
make build
This target runs application in development mode, automatically reloading when code changes are detected. It depends on create-env
and uses CompileDaemon
for automatic reloading.
make run
This target creates environment configuration files, such as .env
and config.yml
. It ensures that these files exist.
make create-env
This target retrieves dependency packages using Go Modules (go mod tidy
).
make mod
This target runs unit tests for application and provides test coverage information. It relies on tparse
for parsing test results.
make test
This target runs the data race detector on your application to identify data race conditions. Like test
, it uses tparse
for parsing test results.
make race
This target checks the code coverage of your tests and generates a coverage report.
make coverage
This target performs code linting on your project to identify potential issues. It uses golangci-lint
for linting.
make lint
This target generates and updates documentation using the Swagger tool (swag
). It parses dependencies for documentation.
make docs
This target builds Docker containers for your application using Docker Compose. Ensure you have Docker and Docker Compose installed.
make docker-build
This target starts your application using Docker Compose in detached mode. It automatically reloads your application within the Docker container.
make docker-up
This target stops the Docker containers created with Docker Compose.
make docker-down
This target prints the logs of Docker containers. It can be useful for debugging when your application is running inside Docker containers.
make docker-log