Created
March 13, 2016 08:46
-
-
Save bbrodriges/476c49611602257dea8a to your computer and use it in GitHub Desktop.
Golang vendoring oneliner
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
# Example: $ ./go-vendoring.sh github.com/gin-gonic/gin | |
# | |
# Step-by-step explanation | |
# 1. Create vender folder in current directory | |
# 2. Downloads package with dependencies | |
# 3. Creates subfolders in vendor folder for any donloaded packages | |
# 4. Copies downloaded packages from $GOPATH/src/ into created subdirectories | |
mkdir -p vendor && go get -v -u -d $1 2>&1 | grep 'download' | awk '{print $1}' | while read package ; do mkdir -p vendor/$package && cp -R $GOPATH/src/$package/* vendor/$package ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment