-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (36 loc) · 844 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
## build: Compile example to binary
.PHONY: build
build:
@echo "> ($@) Running the build..."
@mkdir -p .build
@go build -v
@echo " ($@) Done!"
## test: Run tests
.PHONY: test
test: info
@go test ./...
## coverage: Run coverage
.PHONY: coverage
coverage:
@go test -coverprofile=coverage.out ./...
@go tool cover -func=coverage.out
## help: Show help and exit
.PHONY: help
help: Makefile
@echo
@echo " Choose a command:"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
## info: generate package version - run by go:generate
.PHONY: info
info:
@echo "> ($@) Generating build info..."
@go run info.go -version=${VERSION}
@echo " ($@) Done!"
## docs: Generate documentation - run by go:generate
.PHONY: docs
docs: info
@echo "> ($@) Generating documentation..."
@go run docs.go
@echo " ($@) Done!"