REST API with unit tests and coverage percentage API developed from a Car CRUD, where unit tests are performed and their percentage of coverage API developed in golang using swagger to create test environment
go get github.com/gin-gonic/gingo get github.com/jinzhu/gormgo get github.com/jinzhu/gorm/dialects/postgresgo get github.com/joho/godotenvGET: GET all carsPOST: POST create a new car
GET: GET a carPUT: PUT update a carDELETE: DELETE a car
{
"name": "Sentra", "brand": "Nissan", "year": "2022/12/12"
}
{
"ID": 1, "name": "Skyline", "brand": "Nissan"
}
gotests -all -w .go test -v ./...-
go test -coverprofile name -
go tool cover -html=nameCoverProfile