From 9605c9e171c39ccd5fb8e88249caf376d71176ee Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 16 Oct 2023 11:08:19 +0200 Subject: [PATCH] imp: add go mod tidy all script (#4845) * feat: add go mod tidy all script * feedback --------- Co-authored-by: Jim Fasarakis-Hilliard --- Makefile | 3 +++ scripts/go-mod-tidy-all.sh | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100755 scripts/go-mod-tidy-all.sh diff --git a/Makefile b/Makefile index 4e883c8d8bb..f31a9c8742e 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,9 @@ include contrib/devtools/Makefile BUILD_TARGETS := build install +tidy-all: + ./scripts/go-mod-tidy-all.sh + build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build diff --git a/scripts/go-mod-tidy-all.sh b/scripts/go-mod-tidy-all.sh new file mode 100755 index 00000000000..72b2b9d0e2f --- /dev/null +++ b/scripts/go-mod-tidy-all.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +for modfile in $(find . -name go.mod); do + echo "Updating $modfile" + DIR=$(dirname $modfile) + (cd $DIR; go mod tidy) +done \ No newline at end of file