From 8904b9d035e113e0c052acfed35c4ab5a6d6973b Mon Sep 17 00:00:00 2001 From: Jake Date: Mon, 5 Jun 2017 20:54:15 +0000 Subject: initial commit --- scripts/gofmtcheck.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/gofmtcheck.sh (limited to 'scripts/gofmtcheck.sh') diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh new file mode 100755 index 0000000..1c05581 --- /dev/null +++ b/scripts/gofmtcheck.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Check gofmt +echo "==> Checking that code complies with gofmt requirements..." +gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) +if [[ -n ${gofmt_files} ]]; then + echo 'gofmt needs running on the following files:' + echo "${gofmt_files}" + echo "You can use the command: \`make fmt\` to reformat code." + exit 1 +fi + +exit 0 -- cgit v1.2.3