I am trying to build packages using an existing set of protos that my company has and have run into some issues. I have simplified the issue I am getting to the following workspace. Could someone please give me insight into what I am doing wrong or the appropriate documentation or venue to get help. Thank you and sorry if this is a simple question.
patrick$ echo $GOPATH
/Users/patrick/Code/workspace
patrick$ pwd
/Users/patrick/Code/workspace
patrick$ cat src/foo/foo.proto
package foo;
message Foo
{
optional string foo = 1;
}
patrick$ cat src/bar/bar.proto
package bar;
import "foo/foo.proto";
message Bar
{
optional foo.Foo foo = 1;
optional string bar = 2;
}
patrick$ protoc --go_out=src --proto_path=src/ src/foo/foo.proto
patrick$ protoc --go_out=src --proto_path=src/ src/bar/bar.proto
patrick$ go install foo
patrick$ go build bar
src/bar/bar.pb.go:18:8: cannot find package "foo/foo.pb" in any of:
/usr/local/Cellar/go/1.3/libexec/src/pkg/foo/foo.pb (from $GOROOT)
/Users/patrick/Code/workspace/src/foo/foo.pb (from $GOPATH)