-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reflect/protoregistry: permit conflicting file names
Remove the requirement that all registered files have unique names. Files.FindFileByPath now returns an error if multiple files match the path. Files.RangeFiles iterates over all files, including ones with the same name. Unlike descriptor names, file names are not part of any of the wire encodings. Conflicts in file names only affect file lookups by path, which is an uncommon operation. The Files.RegisterFile documentation already states (inaccurately), "It is permitted for multiple files to have the same file path." This change brings the behavior of RegisterFile in line with the documentation. Fixes golang/protobuf#1122 Change-Id: I2750e35736fd34def23fa6ab6d6a829095a65a26 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/321531 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
- Loading branch information
Showing
2 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters