From 55c9a9d928ea27a7daedac201fa3f883f9c5f9f4 Mon Sep 17 00:00:00 2001 From: Pravendra Singh Date: Fri, 21 Apr 2017 12:44:29 +0530 Subject: [PATCH] Add go format checking on travis --- .travis.gofmt.sh | 7 +++++++ .travis.yml | 1 + 2 files changed, 8 insertions(+) create mode 100644 .travis.gofmt.sh diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100644 index 000000000..962c6a542 --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not properly formatted. Use 'gofmt'." + gofmt -d . + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index 66dd9f951..a07972949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ before_install: fi script: + - . ./.travis.gofmt.sh # Run the unit tests first - | set -e