FiloSottile/gvt

Don't break on mismatched package statements in subpackages

joeblew99 opened this issue · 7 comments

Been trying this out.
Works great so far. Really like it.

When i hit the usual no buildable source code error, it tells me with the normal way.
Maybe you can also detect the same thing, and give a better message. At the moment its a bit cryptic.

x-MacBook-Pro:backend apple$ gvt fetch github.com/gin-gonic/contrib
2016/04/26 18:39:03 command "fetch" failed: loadPackage("/Users/apple/workspace/go/src/bitbucket.org/apparently_different/backend/vendor/github.com/gin-gonic/contrib/sessions/examples", "github.com/gin-gonic/contrib/sessions/examples"): found packages maincookie (example_cookie.go) and mainredis (example_redis.go) in /Users/apple/workspace/go/src/bitbucket.org/apparently_different/backend/vendor/github.com/gin-gonic/contrib/sessions/examples

But traditional way:

x-MacBook-Pro:backend apple$ go get github.com/gin-gonic/contrib
can't load package: package github.com/gin-gonic/contrib: no buildable Go source files in /Users/apple/workspace/go/src/github.com/gin-gonic/contrib

BTW, any recommendations for how to get that repo other than copying it into my vendor folder manually ?

It actually breaks the build, which is correct.
I was wondering if the go build command would search my whole go path but it only looks in my vendor path.
To me thats good ! No false positives.

Hi, thanks for the report!

The two tools are complaining about different things: go get tries to build the package and fails, if you use -d it will go away.

gvt tries to download a subfolder (see #28) that contains files with different "package" entries. This breaks because gvt is trying to be way too smart. Good news is I'm changing that :)

I was wondering if the go build command would search my whole go path but it only looks in my vendor path.

That should not be the case, it looks in vendor first, then in GOPATH.

ah thanks for the correction. i was assuming.

go get -d .. worked, and i copied it into the vendor
then the build worked.
So yep you were spot on ! Thanks for the help.

Happy to hear it worked out. Reopening this, as gvt should still work here.

ok nice