#!/bin/bash set -e if [[ ! -x "$(which go)" && -x /usr/local/go/bin/go ]]; then PATH=/usr/local/go/bin:${PATH} fi cd $(dirname $0)/.. result=$(find . -name "*.go" | grep -v ./Godeps | xargs gofmt -l) for i in $result; do echo $i done [ -n "$result" ] && exit 1 echo OK