diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100755 index 0000000..3aa9374 --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not formatted:" + gofmt -d . + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index 94a0920..37b804b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ before_script: - source .travis.fix-fork.sh script: + - ./.travis.gofmt.sh - go test ./... - mkdir stage - cd stage