From 6e36304a32642d3c28cdb3b1df71091ec09e53f0 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Fri, 28 Feb 2020 15:27:22 -0800 Subject: [PATCH] reflect/protoreflect: ExtensionRangeOptions never returns nil Documentation only change. Change-Id: Ib620efc99bdaab90eeb5404554ae442f345d6f47 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221560 Reviewed-by: Joe Tsai --- reflect/protoreflect/type.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reflect/protoreflect/type.go b/reflect/protoreflect/type.go index 797aa183..41d560e7 100644 --- a/reflect/protoreflect/type.go +++ b/reflect/protoreflect/type.go @@ -212,11 +212,12 @@ type MessageDescriptor interface { // ExtensionRanges is the field ranges used for extension fields. // In Proto3, it is always an empty ranges. ExtensionRanges() FieldRanges - // ExtensionRangeOptions returns the ith extension range options, - // which is a google.protobuf.ExtensionRangeOptions protobuf message. - // The caller must not modify the returned message. + // ExtensionRangeOptions returns the ith extension range options. // - // This method may return a nil interface value if no options are present. + // To avoid a dependency cycle, this method returns a proto.Message value, + // which always contains a google.protobuf.ExtensionRangeOptions message. + // This method returns a typed nil-pointer if no options are present. + // The caller must import the descriptorpb package to use this. ExtensionRangeOptions(i int) ProtoMessage // Enums is a list of nested enum declarations.