go-rest-service-template

module
v0.0.0-...-6ebe9bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2021 License: MIT

README

Go REST service template

Template for REST APIs written in Go.


Working with database migrations

Create go_rest_service database in your PostgreSQL instance

Install sql-migrate

go get -v github.com/rubenv/sql-migrate/...

Position yourself in the db_migrations directory and run

sql-migrate up --env local

Working with unit tests

Position yourself in the root directory and run the tests

go test ./...

Working with integration tests

Create go_rest_service database in your PostgreSQL instance

(Optional) Position yourself in the db_migrations directory and run

sql-migrate up --env integration_tests

Position yourself in the root directory and run the tests

go test ./... -tags integration

Working with the linter

Install golangci-lint

go get -u github.com/golangci/golangci-lint/cmd/golangci-lint

Position yourself in the root directory and run

golangci-lint run --allow-parallel-runners --enable-all -e dupl --timeout 30m

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL