Skip to content

Commit 4b72157

Browse files
committed
makefile: fix checkfmt
1 parent d68093e commit 4b72157

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ XGOARCH := amd64
22
XGOOS := linux
33
XBIN := $(XGOOS)_$(XGOARCH)/atb
44

5-
all: lint test install
5+
all: checkfmt vet test install
66

77
test:
88
go test ./...
99

1010
vet:
1111
go vet ./...
1212

13-
check-fmt:
14-
bash -c "diff --line-format='%L' <(echo -n) <(gofmt -d -s .)"
13+
checkfmt:
14+
@sh -c "test -z $$(gofmt -l .)" || { echo "one or more files need to be formatted: try make fmt to fix this automatically"; exit 1; }
1515

16-
lint: check-fmt vet
16+
fmt:
17+
gofmt -w .
1718

1819
install:
1920
go install ./...

0 commit comments

Comments
 (0)