#!/bin/bash

set -e

. script/bootstrap

echo "Verifying code is formatted via 'gofmt -s -w  go/'"
gofmt -s -w  go/
git diff --exit-code --quiet

echo "Building"
script/build

cd .gopath/src/github.com/github/gh-ost

# TODO: remove GO111MODULE once gh-ost uses Go modules
echo "Running unit tests"
GO111MODULE=off go test ./go/...
