8000 proto: fix stale deprecation documentation on registry functions (#1093) · golang/protobuf@fa093f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa093f5

Browse files
authored
proto: fix stale deprecation documentation on registry functions (#1093)
The documentation unfortunately refers to old declarations that were changed during the development of the `google.golang.org/protobuf` module.
1 parent 1b794fe commit fa093f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proto/registry.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var fileCache sync.Map // map[filePath]fileDescGZIP
2929
// RegisterFile is called from generated code to register the compressed
3030
// FileDescriptorProto with the file path for a proto source file.
3131
//
32-
// Deprecated: Use protoregistry.GlobalFiles.Register instead.
32+
// Deprecated: Use protoregistry.GlobalFiles.RegisterFile instead.
3333
func RegisterFile(s filePath, d fileDescGZIP) {
3434
// Decompress the descriptor.
3535
zr, err := gzip.NewReader(bytes.NewReader(d))
@@ -53,7 +53,7 @@ func RegisterFile(s filePath, d fileDescGZIP) {
5353
// FileDescriptor returns the compressed FileDescriptorProto given the file path
5454
// for a proto source file. It returns nil if not found.
5555
//
56-
// Deprecated: Use protoregistry.GlobalFiles.RangeFilesByPath instead.
56+
// Deprecated: Use protoregistry.GlobalFiles.FindFileByPath instead.
5757
func FileDescriptor(s filePath) fileDescGZIP {
5858
if v, ok := fileCache.Load(s); ok {
5959
return v.(fileDescGZIP)
@@ -98,7 +98,7 @@ var numFilesCache sync.Map // map[protoreflect.FullName]int
9898
// RegisterEnum is called from the generated code to register the mapping of
9999
// enum value names to enum numbers for the enum identified by s.
100100
//
101-
// Deprecated: Use protoregistry.GlobalTypes.Register instead.
101+
// Deprecated: Use protoregistry.GlobalTypes.RegisterEnum instead.
102102
func RegisterEnum(s enumName, _ enumsByNumber, m enumsByName) {
103103
if _, ok := enumCache.Load(s); ok {
104104
panic("proto: duplicate enum registered: " + s)
@@ -181,7 +181,7 @@ var messageTypeCache sync.Map // map[messageName]reflect.Type
181181
// RegisterType is called from generated code to register the message Go type
182182
// for a message of the given name.
183183
//
184-
// Deprecated: Use protoregistry.GlobalTypes.Register instead.
184+
// Deprecated: Use protoregistry.GlobalTypes.RegisterMessage instead.
185185
func RegisterType(m Message, s messageName) {
186186
mt := protoimpl.X.LegacyMessageTypeOf(m, protoreflect.FullName(s))
187187
if err := protoregistry.GlobalTypes.RegisterMessage(mt); err != nil {
@@ -280,7 +280,7 @@ func MessageName(m Message) messageName {
280280
// RegisterExtension is called from the generated code to register
281281
// the extension descriptor.
282282
//
283-
// Deprecated: Use protoregistry.GlobalTypes.Register instead.
283+
// Deprecated: Use protoregistry.GlobalTypes.RegisterExtension instead.
284284
func RegisterExtension(d *ExtensionDesc) {
285285
if err := protoregistry.GlobalTypes.RegisterExtension(d); err != nil {
286286
panic(err)

0 commit comments

Comments
 (0)
0