项目作者: syumai

项目描述 :
A CLI tool to concatenate multiple proto files into a single file.
高级语言: Go
项目地址: git://github.com/syumai/protocat.git
创建时间: 2020-08-10T02:52:49Z
项目社区:https://github.com/syumai/protocat

开源协议:MIT License

下载


protocat

  • protocat concatenates multiple proto files into 1 file.
    • files must be in a single package.

Installation

  1. go get github.com/syumai/protocat/cmd/protocat

Usage

  1. # import paths must be specified by `-I` flag.
  2. protocat -I=example,third_party/protobuf/src example-a.proto example-b.proto

example/example-a.proto

  1. syntax = "proto3";
  2. package example;
  3. import "example-b.proto";
  4. message A {
  5. B b = 1;
  6. }

example/example-b.proto

  1. syntax = "proto3";
  2. package example;
  3. import "google/protobuf/any.proto";
  4. message B {
  5. google.protobuf.Any any = 1;
  6. }

output

  1. syntax = "proto3";
  2. package example;
  3. import "google/protobuf/any.proto";
  4. message A {
  5. B b = 1;
  6. }
  7. message B {
  8. google.protobuf.Any any = 1;
  9. }

License

MIT

Author

syumai