34
34
// package or when the alternate path is only used from one file (so you don't
35
35
// want the alternate path used when loading every other file), use an
36
36
// ImportResolver instead.
37
- //
38
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
39
- // correct and that descriptors can be linked during package initialization. So
40
- // registering alternate paths is no longer useful or necessary.
41
37
func RegisterImportPath (registerPath , importPath string ) {
42
38
if len (importPath ) == 0 {
43
39
panic ("import path cannot be empty" )
@@ -60,10 +56,6 @@ func RegisterImportPath(registerPath, importPath string) {
60
56
// ResolveImport resolves the given import path. If it has been registered as an
61
57
// alternate via RegisterImportPath, the registered path is returned. Otherwise,
62
58
// the given import path is returned unchanged.
63
- //
64
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
65
- // correct and that descriptors can be linked during package initialization. So
66
- // registering alternate paths is no longer useful or necessary.
67
59
func ResolveImport (importPath string ) string {
68
60
importPath = clean (importPath )
69
61
globalImportPathMu .RLock ()
@@ -244,76 +236,48 @@ func (r *ImportResolver) registerImportPathFrom(registerPath, importPath, source
244
236
// LoadFileDescriptor is the same as the package function of the same name, but
245
237
// any alternate paths configured in this resolver are used when linking the
246
238
// given descriptor proto.
247
- //
248
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
249
- // correct and that descriptors can be linked during package initialization. So
250
- // registering alternate paths is no longer useful or necessary.
251
239
func (r * ImportResolver ) LoadFileDescriptor (filePath string ) (* FileDescriptor , error ) {
252
240
return LoadFileDescriptor (filePath )
253
241
}
254
242
255
243
// LoadMessageDescriptor is the same as the package function of the same name,
256
244
// but any alternate paths configured in this resolver are used when linking
257
245
// files for the returned descriptor.
258
- //
259
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
260
- // correct and that descriptors can be linked during package initialization. So
261
- // registering alternate paths is no longer useful or necessary.
262
246
func (r * ImportResolver ) LoadMessageDescriptor (msgName string ) (* MessageDescriptor , error ) {
263
247
return LoadMessageDescriptor (msgName )
264
248
}
265
249
266
250
// LoadMessageDescriptorForMessage is the same as the package function of the
267
251
// same name, but any alternate paths configured in this resolver are used when
268
252
// linking files for the returned descriptor.
269
- //
270
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
271
- // correct and that descriptors can be linked during package initialization. So
272
- // registering alternate paths is no longer useful or necessary.
273
253
func (r * ImportResolver ) LoadMessageDescriptorForMessage (msg proto.Message ) (* MessageDescriptor , error ) {
274
254
return LoadMessageDescriptorForMessage (msg )
275
255
}
276
256
277
257
// LoadMessageDescriptorForType is the same as the package function of the same
278
258
// name, but any alternate paths configured in this resolver are used when
279
259
// linking files for the returned descriptor.
280
- //
281
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
282
- // correct and that descriptors can be linked during package initialization. So
283
- // registering alternate paths is no longer useful or necessary.
284
260
func (r * ImportResolver ) LoadMessageDescriptorForType (msgType reflect.Type ) (* MessageDescriptor , error ) {
285
261
return LoadMessageDescriptorForType (msgType )
286
262
}
287
263
288
264
// LoadEnumDescriptorForEnum is the same as the package function of the same
289
265
// name, but any alternate paths configured in this resolver are used when
290
266
// linking files for the returned descriptor.
291
- //
292
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
293
- // correct and that descriptors can be linked during package initialization. So
294
- // registering alternate paths is no longer useful or necessary.
295
267
func (r * ImportResolver ) LoadEnumDescriptorForEnum (enum protoEnum ) (* EnumDescriptor , error ) {
296
268
return LoadEnumDescriptorForEnum (enum )
297
269
}
298
270
299
271
// LoadEnumDescriptorForType is the same as the package function of the same
300
272
// name, but any alternate paths configured in this resolver are used when
301
273
// linking files for the returned descriptor.
302
- //
303
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
304
- // correct and that descriptors can be linked during package initialization. So
305
- // registering alternate paths is no longer useful or necessary.
306
274
func (r * ImportResolver ) LoadEnumDescriptorForType (enumType reflect.Type ) (* EnumDescriptor , error ) {
307
275
return LoadEnumDescriptorForType (enumType )
308
276
}
309
277
310
278
// LoadFieldDescriptorForExtension is the same as the package function of the
311
279
// same name, but any alternate paths configured in this resolver are used when
312
280
// linking files for the returned descriptor.
313
- //
314
- // Deprecated: the new protobuf runtime (v1.4+) verifies that import paths are
315
- // correct and that descriptors can be linked during package initialization. So
316
- // registering alternate paths is no longer useful or necessary.
317
281
func (r * ImportResolver ) LoadFieldDescriptorForExtension (ext * proto.ExtensionDesc ) (* FieldDescriptor , error ) {
318
282
return LoadFieldDescriptorForExtension (ext )
319
283
}
0 commit comments