Go项目工作区如何与依赖工具和go工具一起使用?

I have a project with packages inside:

  • project package "root": a/b/c (eg github/b/c)
  • in a/b/c we have a lot of packages (p1, p2 ...)
  • project is managed according to How to Write Go Code official recommendations. The local project path is: $GOPATH/src/a/b/c. Also all imports are "not relative".
  • the project has go get-able dependencies

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