(localFD *model.FileDescriptor, globalFD *model.FileDescriptor, rawFieldType string)
| 217 | } |
| 218 | |
| 219 | func findFieldType(localFD *model.FileDescriptor, |
| 220 | globalFD *model.FileDescriptor, |
| 221 | rawFieldType string) (model.FieldType, bool, *model.Descriptor, bool) { |
| 222 | |
| 223 | // 开始在本地symbol中找 |
| 224 | testFD := localFD |
| 225 | |
| 226 | for { |
| 227 | |
| 228 | fieldType, isrepeatd, complexType, ok := findlocalFieldType(testFD, rawFieldType) |
| 229 | |
| 230 | if !ok { |
| 231 | return model.FieldType_None, isrepeatd, nil, false |
| 232 | } |
| 233 | |
| 234 | if fieldType != model.FieldType_None { |
| 235 | return fieldType, isrepeatd, complexType, true |
| 236 | } |
| 237 | |
| 238 | // 已经是全局范围, 说明找不到 |
| 239 | if testFD == globalFD { |
| 240 | |
| 241 | return model.FieldType_None, isrepeatd, nil, true |
| 242 | } |
| 243 | |
| 244 | // 找不到就换全局范围找 |
| 245 | testFD = globalFD |
| 246 | } |
| 247 | |
| 248 | } |
| 249 | |
| 250 | // bool表示是否有错 |
| 251 | func findlocalFieldType(localFD *model.FileDescriptor, rawFieldType string) (model.FieldType, bool, *model.Descriptor, bool) { |
no test coverage detected