MCPcopy
hub / github.com/golang/protobuf / isValidExtension

Function isValidExtension

proto/extensions.go:319–321  ·  view source on GitHub ↗

isValidExtension reports whether xtd is a valid extension descriptor for md.

(md protoreflect.MessageDescriptor, xtd protoreflect.ExtensionTypeDescriptor)

Source from the content-addressed store, hash-verified

317
318// isValidExtension reports whether xtd is a valid extension descriptor for md.
319func isValidExtension(md protoreflect.MessageDescriptor, xtd protoreflect.ExtensionTypeDescriptor) bool {
320 return xtd.ContainingMessage() == md && md.ExtensionRanges().Has(xtd.Number())
321}
322
323// isScalarKind reports whether k is a protobuf scalar kind (except bytes).
324// This function exists for historical reasons since the representation of

Callers 4

HasExtensionFunction · 0.85
ClearExtensionFunction · 0.85
GetExtensionFunction · 0.85
SetExtensionFunction · 0.85

Calls 1

HasMethod · 0.80

Tested by

no test coverage detected