-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1016 Bytes
/
Copy pathMakefile
File metadata and controls
51 lines (38 loc) · 1016 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
40
41
42
43
44
45
46
47
48
49
50
51
.PHONY: build run test cover lint vuln clean fmt vet tidy help
BINARY_NAME := flowlog
GO := go
help:
@echo "Available targets:"
@echo " make build - Build the binary"
@echo " make run - Build and run the binary"
@echo " make test - Run tests with race detector"
@echo " make cover - Run tests and print per-function coverage"
@echo " make lint - Run golangci-lint"
@echo " make vuln - Run govulncheck"
@echo " make fmt - Format code"
@echo " make vet - Run go vet"
@echo " make tidy - Tidy go.mod/go.sum"
@echo " make clean - Remove build artifacts"
build:
$(GO) build -o $(BINARY_NAME) .
run: build
./$(BINARY_NAME)
test:
$(GO) test -race ./...
cover:
$(GO) test -race -coverprofile=coverage.out ./...
$(GO) tool cover -func=coverage.out
lint:
golangci-lint run ./...
vuln:
govulncheck ./...
fmt:
$(GO) fmt ./...
vet:
$(GO) vet ./...
tidy:
$(GO) mod tidy
clean:
$(GO) clean
rm -f $(BINARY_NAME) coverage.out
.DEFAULT_GOAL := help