This commit is contained in:
Родитель
2923964d2f
Коммит
65fd105923
8
Makefile
8
Makefile
|
@ -57,4 +57,10 @@ examples: $(BQ_PLUGIN)
|
|||
|
||||
run:
|
||||
go build -o ~/bin/protoc-gen-bq-schema cmd/main.go
|
||||
protoc -I ~/commerce/commerce-apis/ -I ~/commerce/commerce-apis/third_party/ --bq-schema_out=.scratch --bq-schema_opt=single-message --bq-schema_opt=Mcommerce/subscription.renewed.proto=subscription commerce/subscription.renewed.proto
|
||||
protoc \
|
||||
-I ~/commerce/commerce-apis/ \
|
||||
-I ~/commerce/commerce-apis/third_party/ \
|
||||
--bq-schema_out=.scratch \
|
||||
--bq-schema_opt=single-message \
|
||||
--bq-schema_opt=Mcommerce/order.created.proto=subscription \
|
||||
~/commerce/commerce-apis/commerce/order.created.proto
|
||||
|
|
|
@ -111,6 +111,10 @@ func traverseMessage(pkgName string, msg *descriptor.DescriptorProto, path strin
|
|||
var bqField *BQField
|
||||
schema := make(BQSchema, 0)
|
||||
fields := msg.GetField()
|
||||
if parentMessages[msg] {
|
||||
glog.Errorf("Detected recursion for message %s, ignoring subfields", *msg.Name)
|
||||
return nil
|
||||
}
|
||||
parentMessages[msg] = true
|
||||
for idx, fieldProto := range fields {
|
||||
fieldCommentPath := fmt.Sprintf("%s.%d.%d", path, fieldPath, idx)
|
||||
|
|
Загрузка…
Ссылка в новой задаче