Bump sprig@latest

This commit is contained in:
Manfred Touron
2016-12-15 13:43:43 +01:00
parent 6beb5868e8
commit 869e37e163
26 changed files with 1854 additions and 856 deletions

View File

@@ -626,7 +626,6 @@ func (g *Generator) CommandLineParameters(parameter string) {
}
}
}
if pluginList != "" {
// Amend the set of plugins.
enabled := make(map[string]bool)
@@ -1181,7 +1180,6 @@ func (g *Generator) generate(file *FileDescriptor) {
g.P("const _ = ", g.Pkg["proto"], ".ProtoPackageIsVersion", generatedCodeVersion, " // please upgrade the proto package")
g.P()
}
for _, td := range g.file.imp {
g.generateImported(td)
}
@@ -2078,11 +2076,6 @@ func (g *Generator) generateMessage(message *Descriptor) {
star = "*"
}
// In proto3, only generate getters for message fields and oneof fields.
if message.proto3() && *field.Type != descriptor.FieldDescriptorProto_TYPE_MESSAGE && !oneof {
continue
}
// Only export getter symbols for basic types,
// and for messages and enums in the same package.
// Groups are not exported.
@@ -2141,7 +2134,11 @@ func (g *Generator) generateMessage(message *Descriptor) {
continue
}
if !oneof {
g.P("if m != nil && m." + fname + " != nil {")
if message.proto3() {
g.P("if m != nil {")
} else {
g.P("if m != nil && m." + fname + " != nil {")
}
g.In()
g.P("return " + star + "m." + fname)
g.Out()
@@ -2559,6 +2556,7 @@ func (g *Generator) generateExtension(ext *ExtensionDescriptor) {
g.P("Field: ", field.Number, ",")
g.P(`Name: "`, extName, `",`)
g.P("Tag: ", tag, ",")
g.P(`Filename: "`, g.file.GetName(), `",`)
g.Out()
g.P("}")