From 37e798cd22e21149bb9d5717d0a6e91f1245924f Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Sat, 13 Jan 2018 16:46:37 +0100 Subject: [PATCH] Check gofmt in travis tests --- .travis.gofmt.sh | 8 ++++++++ .travis.yml | 1 + 2 files changed, 9 insertions(+) create mode 100755 .travis.gofmt.sh diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100755 index 0000000..df102ac --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +result="$(gofmt -s -l .)" +if [ -n "$result" ]; then + echo "Go code is not formatted, run 'gofmt -s -w .'" >&2 + echo "$result" + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index c6ba388..2b622a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,5 @@ install: - go get golang.org/x/tools/cmd/cover script: - ./.test-coverage travis-ci + - ./.travis.gofmt.sh - go install github.com/FreifunkBremen/yanic