I have a project with packages inside:
a/b/c
(eg github/b/c) a/b/c
we have a lot of packages (p1, p2 ...) $GOPATH/src/a/b/c
. Also all imports are "not relative". Now I want to use some dependency manager tool like gom or godep . Each of this tool creates an extra directory in repository and puts all vendor dependencies there. Also it plays with GOPATH
and sets it to that vendor directory. Let's assume that the tool will put all vendors in path_to_project/.vendor
- becoming a new GOPATH
.
I want to use one of the go tools ( gofmt
, gorename
, ...) being aware about packages in my projects and vendor directory. The problem is that if GOPATH=path_to_project/.vendor
( godep does this) then tools are not aware about packages in my project.
One idea for this is to set a GOPATH=path_to_project/.vendor:GOPATH
in a shell end editors. Or call every command with gom exec
(gom sets a GOPATH in the above proposition)
Is there any ready and automatic solution for this?
Final goal is to bundle go project with specified dependencies versions (like git commits) and make tools + editors (vim/emacs) working with this tools.
If you are using godep, you can just prefix the go command with godep like this:
godep go build
or
godep go fmt
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.