From 9cc41e665bf2db472e1b5752aa0dccefded6f599 Mon Sep 17 00:00:00 2001 From: Boyan Soubachov Date: Tue, 28 Jan 2020 22:25:54 +1100 Subject: [PATCH] Check go generate on builds * Check if we have mismatching `go generate ./...` output on builds --- .travis.gofmt.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh index bfffdca..3f2e5d3 100755 --- a/.travis.gofmt.sh +++ b/.travis.gofmt.sh @@ -5,3 +5,10 @@ if [ -n "$(gofmt -l .)" ]; then gofmt -d . exit 1 fi + +go generate ./... +if [ -n "$(git status -s -uno)" ]; then + echo "Go generate output does not match commit." + echo "Did you forget to run go generate ./... ?" + exit 1 +fi