Consider using the import map <https://godoc.org/github.com/golang/protobuf/protoc-gen-go/generator#Generator> feature of the protoc-gen-go plugin. Looks something like this:
MAPPING_1="foo/bar.proto=github.com/foo/bar" MAPPING_1="foo/baz.proto=github.com/foo/baz" MAPPINGS="MAPPING_1,MAPPING_2" OPTS="M$MAPPINGS" --go_out=$OPTS:$OUTDIR On Thursday, September 1, 2016 at 2:16:25 PM UTC-6, Reggie Burnett wrote: > We have about 7 proto files that we use for our projects. Each of the > proto files has a different package name and they reference each other > using these package names. > > I didn't really want to have each generated .go file be in it's own > directory so I tried to change the protofiles to generate all the code > under the same Golang package. That didn't seem to work as it was still > generating "import" statements to pull in packages that now no longer exist. > > So now I have gone back to the original protofiles and generated > everything but now we are getting import statements like this: > > import package_name "." > > The "." seems to be telling it that the package is in the same directory > but since Golang packages all have to be in their own directories that is > not working. > > Can someone give me some guidance on properly structuring a situation like > this? > > Thanks > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
