Skip to content

Instantly share code, notes, and snippets.

@l0k18
Last active November 16, 2018 09:45
Show Gist options
  • Save l0k18/63101a5e87fc9425a18a1654cd7fdf9a to your computer and use it in GitHub Desktop.
Save l0k18/63101a5e87fc9425a18a1654cd7fdf9a to your computer and use it in GitHub Desktop.
How to automatically import all dependencies to vendor/ with gvt for Golang repositories

Change directory to the root of an executable (main package), and then:

go install ./cmd/... 2>&1 >/dev/null | grep cannot|cut -d'"' -f2|uniq|sort|xargs -n1 gvt fetch

et voila! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment