#!/bin/bash set -exuo pipefail export GO111MODULE=on echo Generating in root go generate ./... echo Swithcing to _examples and generating again cd _examples && go generate ./... if [[ $(git --no-pager diff) ]] ; then echo "you need to run "go generate ./..." and commit the changes" git --no-pager diff exit 1 fi