Skip to content

Commit 1a8eb67

Browse files
committed
Check gofmt in Travis build
1 parent 455d5c1 commit 1a8eb67

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ go:
66
install:
77
- make get-deps
88
script:
9-
- make all test
9+
- make all check-gofmt test

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,12 @@ get-deps:
3737
go get github.com/robfig/glock
3838
glock sync -n < GLOCKFILE
3939

40+
check-gofmt:
41+
if [ -n "$(shell gofmt -l .)" ]; then \
42+
echo 1>&2 'The following files need to be formatted:'; \
43+
gofmt -l .; \
44+
exit 1; \
45+
fi
46+
4047
test:
4148
go test

0 commit comments

Comments
 (0)