In
google.golang.org/protobuf v1.28.1, reflect/protoregistry/registry.go, comment says:
// It is permitted for multiple files to have the same file path.
func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error {
...
}
But as the code says:
path := file.Path()
if prev := r.filesByPath[path]; len(prev) > 0 {
r.checkGenProtoConflict(path)
err := errors.New("file %q is already registered", file.Path())
err = amendErrorWithCaller(err, prev[0], file)
if !(r == GlobalFiles && ignoreConflict(file, err)) {
return err
}
}
It seems that the code and the comment is not the same.
Please, anyone knows why?