Skip to content

Instantly share code, notes, and snippets.

@jeanbza
Created September 13, 2019 19:19
Show Gist options
  • Save jeanbza/3c1ab3374ec2825108b030d678c7edae to your computer and use it in GitHub Desktop.
Save jeanbza/3c1ab3374ec2825108b030d678c7edae to your computer and use it in GitHub Desktop.
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`!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment