testify/.ci.gogenerate.sh
Olivier Mengué af716f8bff CI: fix shebang in .ci.*.sh scripts
Fix shebang in .ci.*.sh scripts to ease running on platforms where bash
is not in /bin/bash (ex: MacOS).
2025-05-22 11:53:03 +02:00

17 lines
463 B
Bash
Executable File

#!/usr/bin/env bash
# If GOMOD is defined we are running with Go Modules enabled, either
# automatically or via the GO111MODULE=on environment variable. Codegen only
# works with modules, so skip generation if modules is not in use.
if [[ -z "$(go env GOMOD)" ]]; then
echo "Skipping go generate because modules not enabled and required"
exit 0
fi
go generate ./...
if [ -n "$(git diff)" ]; then
echo "Go generate had not been run"
git diff
exit 1
fi