-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (44 loc) · 1.11 KB
/
Makefile
File metadata and controls
53 lines (44 loc) · 1.11 KB
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
49
50
51
52
53
GOPATH ?= $(HOME)/go
GOBIN ?= $(HOME)/bin
VERSION = $(shell git describe --tags --always --dirty)
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
all: help
help:
@echo
@echo "VERSION: $(VERSION)"
@echo "BRANCH: $(BRANCH)"
@echo
@echo "usage: make <command>"
@echo
@echo "commands:"
@echo " mod - populate vendor/ without updating it first"
@echo " build - build apps and installs them in $(GOBIN)"
@echo " test - run unit tests"
@echo " coverage - run unit tests and show coaverage on browser"
@echo " clean - remove generated files and directories"
@echo " run - launch the command tool
@echo
@echo "GOPATH: $(GOPATH)"
@echo "GOBIN: $(GOBIN)"
@echo
mod:
@echo ">>> Populating vendor folder..."
@go mod vendor
build:
@echo ">>> Building app..."
go install -v ./...
@echo
test:
@echo ">>> Running tests..."
go test -count=1 -v ./...
@echo
coverage:
go test ./... -v -coverprofile=coverage.out && go tool cover -html=coverage.out
clean:
@echo ">>> Cleaning..."
go clean -i -r -cache -testcache
@echo
run:
@echo ">>> Running ..."
go run main.go
@echo