// jsonProperties returns parsed proto.Properties for the field and corrects JSONName attribute. func jsonProperties(f reflect.StructField, origName bool) *proto.Properties { var prop proto.Properties prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) if origName || prop.JSONName == "" { prop.JSONName = prop.OrigName } return &prop }
func acceptedJSONFieldNames(f reflect.StructField) fieldNames { var prop proto.Properties prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) opts := fieldNames{orig: prop.OrigName, camel: prop.OrigName} if prop.JSONName != "" { opts.camel = prop.JSONName } return opts }
// jsonFieldName returns the field name to use. func jsonFieldName(f reflect.StructField) string { var prop proto.Properties prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) return prop.OrigName }
// jsonProperties returns parsed proto.Properties for the field. func jsonProperties(f reflect.StructField) *proto.Properties { var prop proto.Properties prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) return &prop }