Skip to content

Instantly share code, notes, and snippets.

@suhlig
Last active November 14, 2023 15:00
Show Gist options
  • Save suhlig/cb94e384c49febc20654e095905904d3 to your computer and use it in GitHub Desktop.
Save suhlig/cb94e384c49febc20654e095905904d3 to your computer and use it in GitHub Desktop.
Update dependencies of all modules in a go workspace
go work edit -json \
| jq --raw-output '.Use.[].DiskPath' \
| xargs -I MODULE zsh -o errexit -c "
cd MODULE
pwd
go get -d -u -t ./...
go mod tidy
[ -d vendor ] && go mod vendor
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment