-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (29 loc) · 802 Bytes
/
Makefile
File metadata and controls
43 lines (29 loc) · 802 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
.DELETE_ON_ERROR: clean
EXECUTABLES = go
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH)))
PROJECT_DEPENDENCIES := $(shell go list -m -f '{{if not (or .Indirect .Main)}}{{.Path}}{{end}}' all)
# avoid mocks in tests
GO_FILES := $(shell go list ./...)
all: clean test
mod-update: tidy
$(foreach dep, $(PROJECT_DEPENDENCIES), $(shell go get -u $(dep)))
go mod tidy
tidy:
go mod tidy
fmt:
@go fmt $(GO_FILES)
vet:
go vet $(GO_FILES)
lint:
golangci-lint run
generate:
go generate $(GO_FILES)
test: tidy fmt vet
go test -race -covermode=atomic -coverprofile coverage.out -tags=unit $(GO_FILES)
test-coverage: test
go tool cover -html=coverage.out
bench:
go test -bench=. -benchmem -benchtime=3s
clean:
rm -rf ./*.out