Template for REST APIs written in Go.
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
Position yourself in the root directory and run the tests
go test ./...
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
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