rename fieldId to fieldID

This commit is contained in:
Pat Moroney 2018-01-12 10:56:25 -07:00
parent decb64ccd8
commit 0b600dd93f

View File

@ -220,7 +220,7 @@ func leadingDetachedComments(i interface{}) []string {
return loc.GetLeadingDetachedComments() return loc.GetLeadingDetachedComments()
} }
func stringFieldExtension(fieldId int32, f *descriptor.FieldDescriptorProto) string { func stringFieldExtension(fieldID int32, f *descriptor.FieldDescriptorProto) string {
if f == nil { if f == nil {
return "" return ""
} }
@ -231,18 +231,18 @@ func stringFieldExtension(fieldId int32, f *descriptor.FieldDescriptorProto) str
var extensionType *string var extensionType *string
eds := proto.RegisteredExtensions(f.Options) eds := proto.RegisteredExtensions(f.Options)
if eds[fieldId] == nil { if eds[fieldID] == nil {
ed := &proto.ExtensionDesc{ ed := &proto.ExtensionDesc{
ExtendedType: extendedType, ExtendedType: extendedType,
ExtensionType: extensionType, ExtensionType: extensionType,
Field: fieldId, Field: fieldID,
Tag: fmt.Sprintf("bytes,%d", fieldId), Tag: fmt.Sprintf("bytes,%d", fieldID),
} }
proto.RegisterExtension(ed) proto.RegisterExtension(ed)
eds = proto.RegisteredExtensions(f.Options) eds = proto.RegisteredExtensions(f.Options)
} }
ext, err := proto.GetExtension(f.Options, eds[fieldId]) ext, err := proto.GetExtension(f.Options, eds[fieldID])
if err != nil { if err != nil {
return "" return ""
} }
@ -255,7 +255,7 @@ func stringFieldExtension(fieldId int32, f *descriptor.FieldDescriptorProto) str
return *str return *str
} }
func boolFieldExtension(fieldId int32, f *descriptor.FieldDescriptorProto) bool { func boolFieldExtension(fieldID int32, f *descriptor.FieldDescriptorProto) bool {
if f == nil { if f == nil {
return false return false
} }
@ -266,18 +266,18 @@ func boolFieldExtension(fieldId int32, f *descriptor.FieldDescriptorProto) bool
var extensionType *bool var extensionType *bool
eds := proto.RegisteredExtensions(f.Options) eds := proto.RegisteredExtensions(f.Options)
if eds[fieldId] == nil { if eds[fieldID] == nil {
ed := &proto.ExtensionDesc{ ed := &proto.ExtensionDesc{
ExtendedType: extendedType, ExtendedType: extendedType,
ExtensionType: extensionType, ExtensionType: extensionType,
Field: fieldId, Field: fieldID,
Tag: fmt.Sprintf("varint,%d", fieldId), Tag: fmt.Sprintf("varint,%d", fieldID),
} }
proto.RegisterExtension(ed) proto.RegisterExtension(ed)
eds = proto.RegisteredExtensions(f.Options) eds = proto.RegisteredExtensions(f.Options)
} }
ext, err := proto.GetExtension(f.Options, eds[fieldId]) ext, err := proto.GetExtension(f.Options, eds[fieldID])
if err != nil { if err != nil {
return false return false
} }