38 lines
No EOL
724 B
Makefile
38 lines
No EOL
724 B
Makefile
.SILENT:
|
|
.DEFAULT_GOAL := run
|
|
|
|
build:
|
|
go build -o server cmd/app/main.go
|
|
|
|
run:
|
|
go run cmd/app/main.go
|
|
|
|
migrate.up:
|
|
go run cmd/migrations/up.go
|
|
|
|
migrate.down:
|
|
go run cmd/migrations/down.go
|
|
|
|
migrate.create:
|
|
migrate create -ext sql -dir migrations -seq $(name)
|
|
|
|
TEST_PKGS := $(shell go list ./... | grep -v "/cmd/" | grep -v "/mocks")
|
|
|
|
test:
|
|
go test -v -short -count=1 -race -coverprofile=coverage.out $(TEST_PKGS)
|
|
|
|
test.many:
|
|
go test -v -short -count=100 -race -coverprofile=coverage.out $(TEST_PKGS)
|
|
|
|
test.full:
|
|
go test -v $(TEST_PKGS)
|
|
|
|
test.race:
|
|
go test -v -race -count=1 $(TEST_PKGS)
|
|
|
|
test.coverage:
|
|
go tool cover -func=coverage.out | grep "total"
|
|
go tool cover -html=coverage.out
|
|
|
|
test.mock:
|
|
go generate ./...
|