Skip to content

Commit 6de0e6f

Browse files
authored
[chore] Fix update-deps script to not miss module upgrades (#5874)
When we run go get... and go tidy in particular modules, it may affect modules that depend on it. If the dependent modules modified, running `go get ...` there fails with ``` go: updates to go.mod needed; to update it: go mod tidy ``` In order to fix that, we need to run go tidy in all the modules after updating every module
1 parent 56abf21 commit 6de0e6f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

update-deps

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ update_gomod() {
4343
if [ -n "$(go list -f '{{if not .Indirect}}{{.Path}}{{end}}' -m ${pkgs}/... 2>/dev/null)" ]; then
4444
echo "Updating ${pkgs}/... in $gomod to $version"
4545
go get ${pkgs}/...@${version}
46-
if [ -f Makefile ]; then
47-
make tidy
48-
else
49-
rm -f go.sum
50-
go mod tidy
51-
fi
5246
fi
5347

5448
popd >/dev/null
@@ -57,6 +51,5 @@ update_gomod() {
5751
for gomod in $( find "$REPO_DIR" -name "go.mod" | grep -v "/examples/" | sort ); do
5852
update_gomod "$gomod" "$CORE_PKGS" "$CORE_VERSION"
5953
update_gomod "$gomod" "$CONTRIB_PKGS" "$CONTRIB_VERSION"
54+
make -C "$REPO_DIR" tidy-all
6055
done
61-
62-
make -C "$REPO_DIR" for-all CMD='make tidy'

0 commit comments

Comments
 (0)