#!/bin/bash

set -e

cd $(dirname $0)/..

. ./scripts/common_functions

set_project_vars

go test ./...

result=$(find . -name "*.go" | grep -v ./Godeps | xargs gofmt -l)
if [ -n "$result" ]; then
    echo "${#result[@]} files failed gofmt check:"
fi
for i in $result; do
    echo $i
done

[ -n "$result" ] && exit 1

echo OK
