-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 742 Bytes
/
Makefile
File metadata and controls
40 lines (29 loc) · 742 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
SHELL := /usr/bin/env bash
GO ?= go
GO_FILES := $(shell git ls-files '*.go')
.PHONY: fmt fmt-check mod-tidy-check vet test test-race build examples ci
fmt:
$(GO) fmt ./...
fmt-check:
@out="$$(gofmt -l $(GO_FILES))"; \
if [[ -n "$$out" ]]; then \
echo "These files are not gofmt-formatted:"; \
echo "$$out"; \
exit 1; \
fi
mod-tidy-check:
$(GO) mod tidy
@git diff --exit-code -- go.mod go.sum
vet:
$(GO) vet ./...
test:
$(GO) test ./...
test-race:
$(GO) test -race ./...
build:
$(GO) build ./...
examples:
$(GO) run ./examples/basic-authorization >/dev/null
$(GO) run ./examples/transaction-batching >/dev/null
$(GO) run ./examples/send-userop >/dev/null
ci: fmt-check mod-tidy-check vet test-race build examples