1#!/bin/bash 2 3if [ -n "$(gofmt -l .)" ]; then 4 echo "Go code is not formatted:" 5 gofmt -d . 6 exit 1 7fi 8 9go generate ./... 10if [ -n "$(git status -s -uno)" ]; then 11 echo "Go generate output does not match commit." 12 echo "Did you forget to run go generate ./... ?" 13 exit 1 14fi