File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ SHELL := /usr/bin/env bash
2+
3+ GO ?= go
4+ GO_FILES := $(shell git ls-files '* .go')
5+
6+ .PHONY : fmt fmt-check mod-tidy-check vet test test-race build examples ci
7+
8+ fmt :
9+ $(GO ) fmt ./...
10+
11+ fmt-check :
12+ @out=" $$ (gofmt -l $( GO_FILES) )" ; \
13+ if [[ -n " $$ out" ]]; then \
14+ echo " These files are not gofmt-formatted:" ; \
15+ echo " $$ out" ; \
16+ exit 1; \
17+ fi
18+
19+ mod-tidy-check :
20+ $(GO ) mod tidy
21+ @git diff --exit-code -- go.mod go.sum
22+
23+ vet :
24+ $(GO ) vet ./...
25+
26+ test :
27+ $(GO ) test ./...
28+
29+ test-race :
30+ $(GO ) test -race ./...
31+
32+ build :
33+ $(GO ) build ./...
34+
35+ examples :
36+ $(GO ) run ./examples/basic-authorization > /dev/null
37+ $(GO ) run ./examples/transaction-batching > /dev/null
38+ $(GO ) run ./examples/send-userop > /dev/null
39+
40+ ci : fmt-check mod-tidy-check vet test-race build examples
You can’t perform that action at this time.
0 commit comments