From 5237171160d8b78bf281599273a9006999dc223e Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Thu, 2 Jul 2026 18:59:20 -0700 Subject: [PATCH] update-go-mod updates itself too Signed-off-by: Ryan Richard --- hack/update-go-mod/update-go-mod.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hack/update-go-mod/update-go-mod.sh b/hack/update-go-mod/update-go-mod.sh index 69f8c0630..efc8047a6 100755 --- a/hack/update-go-mod/update-go-mod.sh +++ b/hack/update-go-mod/update-go-mod.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2023-2025 the Pinniped contributors. All Rights Reserved. +# Copyright 2023-2026 the Pinniped contributors. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -10,6 +10,8 @@ ROOT_DIR="$SCRIPT_DIR/../.." GO_MOD="${ROOT_DIR}/go.mod" +echo "Updating $GO_MOD ..." + pushd "${SCRIPT_DIR}" >/dev/null script=$(go run . "${GO_MOD}" overrides.conf) popd >/dev/null @@ -21,6 +23,14 @@ pushd "${ROOT_DIR}" >/dev/null eval "$script" popd >/dev/null +# Next update the go.mod of update-go-mod itself. +echo "Updating $SCRIPT_DIR/go.mod ..." + +pushd "${SCRIPT_DIR}" >/dev/null +go get "golang.org/x/mod@latest" +go mod tidy +popd >/dev/null + # This script assumes that you are using the latest version of Go so it can detect its # version and update all the go.mod files to use that version. go_version="$(go version | cut -d ' ' -f3 | sed 's/^go//')"