MCPcopy Create free account
hub / github.com/bufbuild/buf / validateProtoImageFile

Function validateProtoImageFile

private/bufpkg/bufimage/validate.go:40–53  ·  view source on GitHub ↗
(protoImageFile *imagev1.ImageFile)

Source from the content-addressed store, hash-verified

38}
39
40func 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
55func validateProtoModuleInfo(protoModuleInfo *imagev1.ModuleInfo) error {
56 if protoModuleName := protoModuleInfo.GetName(); protoModuleName != nil {

Callers 1

validateProtoImageFunction · 0.85

Calls 5

validateProtoModuleInfoFunction · 0.85
GetBufExtensionMethod · 0.80
GetUnusedDependencyMethod · 0.80
GetDependencyMethod · 0.65
GetModuleInfoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…