Skip to content

Instantly share code, notes, and snippets.

@jee1mr jee1mr/gogetauto
Created Jul 6, 2015

Embed
What would you like to do?
Auto script for getting Go dependencies
#!/usr/bin/python
import re
import commands
build_error = commands.getoutput("go build")
print "go build errors:"
print build_error
sources = re.findall(r"cannot find package \"[a-zA-Z.\/]*\"",build_error)
print "Running go get:"
for source in sources:
link = source.strip("cannot find package")
print("Getting " + link)
commands.getoutput("go get "+link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.