(protoImageFile *imagev1.ImageFile)
| 38 | } |
| 39 | |
| 40 | func validateProtoImageFile(protoImageFile *imagev1.ImageFile) error { |
| 41 | if protoImageFileExtension := protoImageFile.GetBufExtension(); protoImageFileExtension != nil { |
| 42 | lenDependencies := len(protoImageFile.GetDependency()) |
| 43 | for _, index := range protoImageFileExtension.GetUnusedDependency() { |
| 44 | if int(index) >= lenDependencies || int(index) < 0 { |
| 45 | return fmt.Errorf("unused dependency index %d is out of range", index) |
| 46 | } |
| 47 | } |
| 48 | if protoModuleInfo := protoImageFileExtension.GetModuleInfo(); protoModuleInfo != nil { |
| 49 | return validateProtoModuleInfo(protoModuleInfo) |
| 50 | } |
| 51 | } |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | func validateProtoModuleInfo(protoModuleInfo *imagev1.ModuleInfo) error { |
| 56 | if protoModuleName := protoModuleInfo.GetName(); protoModuleName != nil { |
no test coverage detected
searching dependent graphs…