Merge pull request #37296 from ncdc/skip-dash-in-protobuf-tags

Automatic merge from submit-queue

Fix skipping - protobuf fields

**What this PR does / why we need it**: fixes the protobuf generator to skip fields with a protobuf tag of `"-"`

Match changes in https://github.com/kubernetes/gengo/pull/19

I couldn't get godeps to work to vendor this change in from gengo, so I made the same edits manually in cmd/libs/go2idl. A task for another day...

@smarterclayton
This commit is contained in:
Kubernetes Submit Queue 2016-12-22 19:36:25 -08:00 committed by GitHub
commit 9541c38f39

View File

@ -630,7 +630,12 @@ func membersToFields(locator ProtobufLocator, t *types.Type, localPackage types.
Extras: make(map[string]string),
}
if err := protobufTagToField(tags.Get("protobuf"), &field, m, t, localPackage); err != nil {
protobufTag := tags.Get("protobuf")
if protobufTag == "-" {
continue
}
if err := protobufTagToField(protobufTag, &field, m, t, localPackage); err != nil {
return nil, err
}