I have two proto files in the following directories -
parsers/ > flights/ > flights_proto/ > flights.proto > flights.pb.go > flightspostbooking > flights_postbooking_proto/ > flights_postbooking.proto > flights_postbooking.pb.go Following are the contents of the proto files -
flights.proto ============= package "flights_proto"; message Flight { ... } flights_postbooking.proto ========================= package "flights_postbooking_proto" import "flights_proto/flights.proto" message Cancel { Flight flight = 1; ... } I am unable to figure out how to compile the flights_postbooking.proto to generate the pb.go file.
I tried to do the following from the parsers directory.
protoc --proto_path=flightspostbooking/flights_postbooking_proto --proto_path=flights/flights_proto flightspostbooking/flights_postbooking_proto/flights_postbooking.proto --go_out=plugins:flights_postbooking_proto But I get an error that flights_proto/flights.proto: File not found