modulepackage
0.0.0-20240729175701-b7fbb66308d6
Repository: https://github.com/gabrielap542/gotaskapi.git
Documentation: pkg.go.dev
# README
Golang API
Dependencies
- Gin - Framework, v1.9.1
- GORM - Object Relational Mapping, v1.25.6
- Testify - testing toolkit, v1.8.4
- swag - swagger, v1.6.0
- gin-swagger - gin middleware to swagger, v1.16.3
Requirements
- docker-engine or docker desktop at least version 25.0.2
- docker compose 2.24.5 or above
- golang 1.21.6 or above for develop
Tools
- Visual Studio Code - IDE
- Bash - terminal
- Postman - testing
Building
local dev
- go to repo location in your computer and use the following command to download and install all dependencies
$ go mod tidy
docker
- Open terminal and go to the repositories's directory
- Build docker compose
$ docker compose build
- Start docker compose
$ docker compose up
Testing
unit testing
- executes all unit testing
$ go test ./...
code coverage
- Open terminal and go to the repositories's directory
- Execute command to create coverage.out via unit testing
go test -coverprofile=coverage.out ./...
- Execute command to generate html file
go tool cover -html=coverage.out -o coverage.html
- Open html file on browser to check coverage