forked from golang-standards/project-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (32 loc) · 909 Bytes
/
Makefile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
all: deps lint
.PHONY: test clean format lint coverage coverage-html build build-for-mac build-for-windows
deps:
./deps.sh
test:
go test -v -covermode=count -coverprofile=coverage.out ./...
coverage:
go test -covermode=count -coverprofile=coverage.out ./...
coverage-html:
make coverage && go tool cover -html=coverage.out
format:
go vet ./... && go fmt ./...
build:
make api-docs && make format && go build -o ./tmp/auth-server ./api/main.go
build-for-mac:
GOOS=darwin GOARCH=amd64 make build
build-for-windows:
GOOS=windows GOARCH=386 make api-docs && make format && go build -o ./tmp/auth-server.exe ./api/main.go
clean:
rm -r -f ./tmp
lint:
golangci-lint run
run-dev:
make format && air -c .air.config
run:
make api-docs && make format && go run api/main.go
run-cli:
make format && go run cmd/cli/main.go
api-docs:
swag init -g api/main.go
ci:
make all build