-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 945 Bytes
/
Makefile
File metadata and controls
32 lines (22 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
SHELL := /bin/bash
SRC = $(shell find . -type f -name '*.go' -not -iname '*.pb.*' -not -iname '*_mock_test.go')
lint:
@golangci-lint run ./...
mocks:
mockgen -source=internal/infrastructure/router/router.go -destination=internal/infrastructure/server/router_mock_test.go -package=server
mockgen -source=internal/usecase/mocker/usecase.go -destination=internal/infrastructure/server/usecase_mock_test.go -package=server
mockgen -source=internal/usecase/mocker/services.go -destination=internal/usecase/mocker/services_mock_test.go -package=mocker
test:
@go test -coverpkg=./internal/... -coverprofile=cover.out ./internal/...
cover: test
@go tool cover -func cover.out
build:
@echo " > Building binary..."
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o mocker cmd/mocker/main.go
clean:
@go clean
fmt:
@gofmt -s -l -w $(SRC)
goimports:
@goimports -w -local github.com/golangci/golangci-lint $(SRC)
format: fmt goimports