-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (26 loc) · 696 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (26 loc) · 696 Bytes
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
BINARY := byteproxy
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -s -w -X main.version=$(VERSION)
.PHONY: all build run test race cover vet fmt fmt-check lint check clean
all: check build
build:
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$(BINARY) .
run:
go run .
test:
go test -count=1 ./...
race:
go test -race -count=1 ./...
cover:
go test -count=1 -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
vet:
go vet ./...
fmt:
gofmt -w .
fmt-check:
@test -z "$$(gofmt -l .)" || (gofmt -l . && echo "run make fmt" && exit 1)
lint: fmt-check vet
check: lint test
clean:
rm -rf bin coverage.out