-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (33 loc) · 788 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
export GO111MODULE=on
check-env:
ifndef GOPATH
@echo "[Makefile] GOPATH FAIL - Environment variable not set."
@exit 1
else
@echo "[Makefile] GOPATH OK"
endif
ifndef DATABASE_URL
@echo "[Makefile] DATABASE_URL FAIL - Environment variable not set."
@exit 1
else
@echo "[Makefile] DATABASE_URL OK"
endif
ifndef PONG_TOKEN
@echo "[Makefile] PONG_TOKEN FAIL - Environment variable not set."
else
@echo "[Makefile] PONG_TOKEN OK"
endif
run: check-env
@go run main.go
build: check-env
@go build -o bin/pong
lint:
@golangci-lint run
linter-install:
@go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
test: check-env
@go test -gcflags=-l ./... -coverprofile coverage.txt
cover: test
@go tool cover -func coverage.txt
opencover:
@go tool cover -html coverage.txt