forked from lxc/go-lxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 1 KB
/
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
NO_COLOR=\033[0m
OK_COLOR=\033[0;32m
all: format vet lint
format:
@echo "$(OK_COLOR)==> Formatting the code $(NO_COLOR)"
@gofmt -s -w *.go
@goimports -w *.go || true
test:
@echo "$(OK_COLOR)==> Running go test $(NO_COLOR)"
@sudo `which go` test -v
test-race:
@echo "$(OK_COLOR)==> Running go test $(NO_COLOR)"
@sudo `which go` test -race -v
test-unprivileged:
@echo "$(OK_COLOR)==> Running go test for unprivileged user$(NO_COLOR)"
@`which go` test -v
test-unprivileged-race:
@echo "$(OK_COLOR)==> Running go test for unprivileged user$(NO_COLOR)"
@`which go` test -race -v
cover:
@sudo `which go` test -v -coverprofile=coverage.out
@`which go` tool cover -func=coverage.out
doc:
@`which godoc` gopkg.in/lxc/go-lxc.v2 | less
vet:
@echo "$(OK_COLOR)==> Running go vet $(NO_COLOR)"
@`which go` vet .
lint:
@echo "$(OK_COLOR)==> Running golint $(NO_COLOR)"
@`which golint` . || true
escape-analysis:
@go build -gcflags -m
ctags:
@ctags -R --languages=c,go
.PHONY: all format test doc vet lint ctags