Simple Gin Starter project with some industry standard tools setup
Clone this repository git clone https://github.com/thomasmendez/go-template-simple-server.git
or click 'Use this template'
in the Github UI to use the current project as a template.
Install the latest version of Go here
Verify Go is installed by checking the Go version with go version
This project uses the Makefile
in order to easily run sets of commands. The commands can also be run invidually using the commands listed for the makefile command
Run make tidy
in order to run the Go commands needed to install releated dependencies properly
Create a .env
file from the .env.example
file and modify the environment variables as needed
To build the project run make build
Note: Make sure Docker is running on your machine
The microservice can be build and deployed with make docker
API documentation can be viewed at http://localhost:8081/api/swagger
Application can stop running by pressing ctrl+c
on the terminal
To run the unit test for the project, run make test
Gin is a high performance web framework in Golang
Viper is a highly flexible configuration library
Zap fast, structured, leveled logging in Golang
Testify is an assertion library. Can also be used for mocking and building testing suites
Swagger is used as API documentation
Can be modified in the swagger/swagger.yaml
file
Docker allows you to build and run this microservice
Husky allows you to run scripts in the git lifecyle
This project is configured to run test before making a successful commit
Modify the pre-commit
hook with commands you wish to run before committing