警告:缺少 'go_package' 选项

WARNING: Missing 'go_package' option

我在 运行 生成 pb.go 文件的协议命令后收到以下错误 但是我可以生成 pb.go 文件。我该如何减轻以下错误

Missing 'go_package' option in "job.proto",
please specify it with the full Go package path as
a future release of protoc-gen-go will require this be specified.

"Import path" is the path another package would use to import the generated code, e.g. github.com/me/myproject/model or You can simply define the import path based on your preference.

You can simply define your optional import path as follows

option go_package = ".;<Your_Import_path>";

For example, we can assume the package path as "/pub", So the statement as follows.

option go_package = ".;pub";

Then you can simply execute the protoc command to generate the pb.go file

protoc -I=<ABS_PATH_OUTPUT_DIR> --go_out=<ABS_PATH_PROTO_FILE>