octoplex/mise/tasks/check_gomod
2025-01-22 06:52:15 +01:00

14 lines
264 B
Bash
Executable File

#!/usr/bin/env bash
#MISE description="Check if go.mod and go.sum are up-to-date"
set -euo pipefail
go mod tidy
STATUS=$(git status --porcelain go.mod go.sum)
if [ -n "$STATUS" ]; then
echo "Run \`go mod tidy\` and commit the changes."
exit 1
fi
exit 0