all: Update protobuf package 1.0.0 -> 1.2.0 (#5452)

Also adds a few file global options to keep the generated code similar
to what we already had.
This commit is contained in:
Jakob Borg
2019-01-14 11:53:36 +01:00
committed by GitHub
parent c87411851d
commit b01edca420
132 changed files with 41655 additions and 16821 deletions

View File

@@ -184,7 +184,7 @@ func (p *union) Generate(file *generator.FileDescriptor) {
goTyp, _ := p.GoType(message, field)
obj := p.ObjectNamed(field.GetTypeName()).(*generator.Descriptor)
if gogoproto.IsUnion(obj.File(), obj.DescriptorProto) {
if gogoproto.IsUnion(obj.File().FileDescriptorProto, obj.DescriptorProto) {
p.P(`this.`, fieldname, ` = new(`, generator.GoTypeToName(goTyp), `)`)
p.P(`if set := this.`, fieldname, `.SetValue(value); set {`)
p.In()