Stick the following in your ~/.bash_profile
:
function tidyall {
for i in `find . -name go.mod`; do
pushd `dirname $i`;
go mod tidy;
popd;
done
}
alias tidyall=tidyall
Then, run $ tidyall
from your project root to run go mod tidy
on all modules within your project.
(don't forget to run $ source ~/.bash_profile
before trying to use your updated ~/.bash_profile
!)