-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 783 Bytes
/
Makefile
File metadata and controls
45 lines (33 loc) · 783 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
MAKEFLAGS += --always-make
all: generate fmt lint test test-examples tidy
# run tests
test:
go test -race -shuffle=on ./...
# check that examples output is correct
test-examples:
go test -tags e2e -count=1 ./examples_test.go
# format source code
fmt:
golangci-lint fmt
# lint source code
lint:
golangci-lint run --tests=false
# run code generation
generate:
go generate ./...
# tidy up go.mod
tidy:
go mod tidy -v
doc:
go run golang.org/x/pkgsite/cmd/pkgsite@latest -open
# get test coverage
coverage:
go test -coverprofile=coverage.out -coverpkg=./... ./...
go tool cover -func coverage.out
# visualize test coverage
coverage-html: coverage
go tool cover -html coverage.out
install:
go install ./cmd/testo
update-examples-output:
./update-examples-output.sh