#!/usr/bin/env bash
set -euo pipefail
export GOPROXY=off GOFLAGS=-mod=mod
git diff --quiet HEAD -- internal/httpx/client.go || { echo "internal/httpx was modified"; exit 1; }
go build ./... 2>&1
go vet ./... 2>&1
grep -q 'Timeout: 5 \* time.Second\|Timeout: *5\*time.Second' internal/fetch/fetch.go || { echo "fetch lost its 5s timeout"; exit 1; }
grep -q 'Timeout: 2 \* time.Second\|Timeout: *2\*time.Second' internal/health/health.go || { echo "health lost its 2s timeout"; exit 1; }
grep -q 'Timeout: 30 \* time.Second\|Timeout: *30\*time.Second' internal/proxy/proxy.go || { echo "proxy lost its 30s timeout"; exit 1; }
echo "all call sites updated"