@@ -54,58 +54,29 @@ test: tools/bin/gotestsum ## Runs package test including race condition.
54
54
$(call target)
55
55
@CGO_ENABLED=${CGO_ENABLED} ${GO_TEST} ${GO_TEST_FLAGS} -run=${GO_TEST_FUNC} -tags=' $(subst $(space),$(comma),${GO_BUILDTAGS})' ${GO_TEST_PKGS}
56
56
57
- .PHONY : test/gojay
58
- test/gojay : GO_BUILDTAGS+=gojay
59
- test/gojay : TARGET=test/gojay
60
- test/gojay : test
61
-
62
- .PHONY : bench
63
- bench : GO_TEST=go test
64
- bench : # # Take a package benchmark.
65
- $(call target)
66
- @CGO_ENABLED=${CGO_ENABLED} ${GO_TEST} -run=' ^$$' -bench=${GO_BENCH_FUNC} ${GO_BENCH_FLAGS} $(strip ${GO_FLAGS}) ${GO_TEST_PKGS}
67
-
68
57
.PHONY : coverage
69
58
coverage : CGO_ENABLED=1
70
59
coverage : tools/bin/gotestsum # # Takes packages test coverage.
71
60
$(call target)
72
61
CGO_ENABLED=${CGO_ENABLED} ${GO_TEST} ${GO_TEST_FLAGS} -covermode=atomic -coverpkg=./... -coverprofile=coverage.out $(strip ${GO_FLAGS}) ${GO_PKGS}
73
62
74
- .PHONY : coverage/gojay
75
- coverage/gojay : GO_BUILDTAGS+=gojay
76
- coverage/gojay : coverage
77
-
78
63
79
64
# #@ fmt, lint
80
65
81
66
.PHONY : lint
82
67
lint : fmt lint/golangci-lint # # Run all linters.
83
68
84
- .PHONY : lint
85
- lint/gojay : fmt/gojay lint/golangci-lint/gojay
86
-
87
69
.PHONY : fmt
88
70
fmt : tools/goimportz tools/gofumpt # # Run goimportz and gofumpt.
89
71
$(call target)
90
72
find . -iname " *.go" -not -path " ./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN} /goimportz -local=${PKG} ,$(subst /protocol,,$(PKG ) ) -w
91
73
find . -iname " *.go" -not -path " ./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN} /gofumpt -extra -w
92
74
93
- .PHONY : fmt/gojay
94
- fmt/gojay : tools/goimportz tools/gofumpt
95
- $(call target)
96
- @export GOFLAGS=-tags=gojay
97
- find . -iname " *.go" -not -path " ./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN} /goimportz -local=${PKG} ,$(subst /protocol,,$(PKG ) ) -w
98
- find . -iname " *.go" -not -path " ./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN} /gofumpt -extra -w
99
-
100
75
.PHONY : lint/golangci-lint
101
76
lint/golangci-lint : tools/golangci-lint .golangci.yml # # Run golangci-lint.
102
77
$(call target)
103
78
${TOOLS_BIN} /golangci-lint -j ${JOBS} run $(strip ${GO_LINT_FLAGS}) ./...
104
79
105
- .PHONY : lint/golangci-lint/gojay
106
- lint/golangci-lint/gojay : GO_LINT_FLAGS+=--build-tags=gojay
107
- lint/golangci-lint/gojay : lint/golangci-lint
108
-
109
80
110
81
# #@ tools
111
82
0 commit comments