Import protobuf models into other and compile them
tsjd [To short, just do];
- Define go_package option something like:
option go_package = "github.com/meysampg/project_name/pb/folder_name_which_compiled_model_must_be_on_it";
- Import package on a
.proto
file with an address from project root, like
$ cat pb/pb/package/file.proto
syntax = "proto3";
import "pb/another_package/antoher_file.proto";
package file;
- Run pb compiler command from the project root:
$ protoc pb/package/file.proto -I. --go_out=plugins=grpc:$GOPATH/src
- Now Models will be under
pb/folder_name_which_compiled_model_must_be_on_it
folder (relative to project root).