From aeab8f55bdfd69d253bf6471c0189209b7cc027a Mon Sep 17 00:00:00 2001 From: James Shubin Date: Tue, 5 Apr 2016 04:15:50 -0400 Subject: [PATCH] Fix go generate issue with path Gah, I hate you $GOPATH... --- misc/go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/go b/misc/go index 7e612698..a73d5aad 100755 --- a/misc/go +++ b/misc/go @@ -3,6 +3,9 @@ # thanks to Nilium in #go-nuts for 1/3 of the idea [ -z "$GOPATH" ] && echo '$GOPATH is not set!' && exit 1 GO="$(which -a go | sed -e '2q;d')" # TODO: pick /usr/bin/go in a better way +if [ "$1" = "generate" ]; then + exec $GO "$@" # go generate is stupid and gets confused by $GOPATH +fi # the idea is to have $project/gopath/src/ be a symlink to ../vendor but you put # all of your vendored things in vendor/ but with this gopath can be per project if [ -d "$PWD/vendor/" ] && [ -d "$PWD/gopath/" ] && [ "`readlink $PWD/gopath/src`" = "../vendor" ] ; then