Skip to content

Commit 14bd2ff

Browse files
committed
Add gofmt check for Travis
This will help ensure that code is properly formatted.
1 parent 19e018c commit 14bd2ff

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.travis.gofmt.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
cd "$(dirname $0)"
4+
5+
BADLY_FORMATTED="$(go fmt ./...)"
6+
7+
if [[ -n $BADLY_FORMATTED ]]; then
8+
echo "The following files are badly formatted: $BADLY_FORMATTED"
9+
exit 1
10+
fi

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ language: go
22

33
install: go get
44

5-
script: go test -short
5+
script:
6+
- ./.travis.gofmt.sh
7+
- go test -short

0 commit comments

Comments
 (0)