0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

protocをワイルドカードのprotoファイルに適用する方法

Posted at

protocol配下にprotofileがある場合

[~/go/src/github.com/backend]$ tree -L 1 protocol                                                                                                                                                                                                                                              
protocol
├── helloworld.proto
├── vendor
└── workspace.proto

1 directory, 2 files

ワイルドカード適用前

これだとうまくいかない。

protoc --proto_path=protocol -Iprotocol -Iprotocol/vendor/protobuf/src *.proto \
  --go_out=plugins=grpc:${SERVER_OUTPUT_DIR}

ワイルドカード適用後

--proto_pathの指定を無視して、相対パスでワイルドカード先を指定してやれば良い

protoc --proto_path=protocol -Iprotocol -Iprotocol/vendor/protobuf/src ./protocol/*.proto \
  --go_out=plugins=grpc:${SERVER_OUTPUT_DIR}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?