diff --git a/Makefile b/Makefile index 4da71c7c43..64bd77ceef 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,9 @@ go.sum: go.mod @echo "--> Ensure dependencies have not been modified" @go mod verify +go-mod-tidy: + @contrib/scripts/go-mod-tidy-all.sh + clean: @echo "--> Cleaning..." @rm -rf $(BUILD_DIR)/** $(DIST_DIR)/** diff --git a/contrib/scripts/go-mod-tidy-all.sh b/contrib/scripts/go-mod-tidy-all.sh new file mode 100755 index 0000000000..f794ec5b77 --- /dev/null +++ b/contrib/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 --compat=1.17) +done