gopro与protobuf与dep

how am I supposed to use golang protobufs with dep. If I create a project $GOPATH/src/my_test . My main problems:

  • protobuf requires that code is generated with a compatible compiler to the library. How to tell dep to download compiler code when it's not used in code and it gets pruned?
  • If I have 2 protobufs outside go repo that have structure proto_root/users/user.go and proto_root/people/person.go and one references another, where should I generate code so that the generate code looks up the libraries in vendor folders?

It seems that if I configure the dep GOPKG.toml to require my protobuf folders and the compiler I can call

dep ensure -add github.com/golang/protobuf/protoc-gen-go

I can build the compiler and the code won't be pruned. And set --go_out to the vendor folder. Seems to be working