Golang 1.7.3 Ignoring the Vendor Folder

My Golang 1.7.3 ignores the vendor folder. My GOPATH is set c:/gocode it has the bin ,src and pkg folders. My project is at c:/gocode/src/myproj. It has the vendor folder in it.
What am i missing.?
When i do a go get while on myproj directory. go ignores the vendor folder on my project and installs the packages on the src folder

go get will always install to src.

The point of vendoring is that you need to go get the code that you want to work with and move that into your myproj/vendor folder.

When you go build it will use the vendor’ed folders rather than the folders in your src folder.

Hope this makes sense.

So you mean i have to copy the package downloaded on my src folder to the vendor folder on my project myproj? I thought if go detects avendor folder it will place the package downloaded in it and not the src folder.

Go does not have dependency management figured out yet. Sorry. There are plenty of 3rd party dependency managers that will happily do this for you.

There’s nothing official from the Go creators. They’re working on this problem now, but only because the community insisted that everyone sit down and figure this out.

The point is that go build respects the vendor folder and will only build from that directory (and, that’s important).

1 Like

Yes.

I recommend dpw/vendetta to automate this.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.