Created
September 13, 2019 19:19
-
-
Save jeanbza/3c1ab3374ec2825108b030d678c7edae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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