Files
openai.openai-go/scripts/check-go-mod
2026-01-27 23:32:58 +00:00

20 lines
548 B
Bash
Executable File

#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/.."
echo "==> Checking go.mod is tidy"
go mod tidy
if ! git diff --exit-code -- go.mod go.sum; then
echo "go.mod or go.sum has uncommitted changes. Please run 'go mod tidy' and commit the changes."
exit 1
fi
echo "==> Checking examples/go.mod is tidy"
(cd examples && go mod tidy)
if ! git diff --exit-code -- examples/go.mod examples/go.sum; then
echo "examples/go.mod or examples/go.sum has uncommitted changes. Please run 'cd examples && go mod tidy' and commit the changes."
exit 1
fi