Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 3.06 KB

File metadata and controls

105 lines (72 loc) · 3.06 KB

Example API REST in GO

The implementation using ECHO web framework

Install "GO"

How do I use

  • Clone repository
 go mod download
  • Migration system
    Migrations will executation with gormigrate.
    gormigrate working together gorm for execute migrations

    • Execute initial migrations

      go run run-migrations.go
    • Create a new migration
      You'll add a new file in folder /migration. File name will migration id.

  • Run app

    • In terminal

      go run src/main.go
    • Or application Debugging for VSCODE.
      Install extension golang for VSCODE. In launch.json set your envs.
      Click F5 and add your breakpoints.

    • Or run in docker.
      Docker compose will create postgres db and its application.

      docker-compose up
  • Run Unit tests

    • In terminal
      go test  ./test/unit/... -race -covermode=atomic  -v -coverpkg=./src/... -coverprofile=coverage.out
  • Run Integration tests

    • In terminal
      go test  ./test/integration/... -race -covermode=atomic  -v -coverpkg=./src/... -coverprofile=coverage.out
  • Run All tests

    • In terminal
      go test  ./test/... -race -covermode=atomic  -v -coverpkg=./src/... -coverprofile=coverage.out
  • Export (HTML) collection coverage

    • In terminal
      go tool cover -html=coverage.out -o=coverage.html

Contributing

If you've ever wanted to contribute to open source, and a great cause, now is your chance!

See the contributing docs for more information

Contributors ✨


JP. Nobrega

💬 📖 👀 📢

License

MIT