-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal_gengo: switch back from string literal to hex byte slice
It tourns out that Piper (the revision control system Google uses) has a check that requires marking files containing non-UTF8 bytes as binary, preventing textual review. We wanted to avoid this issue in http://go.dev/cl/638135 and added \r to the escape set for Gerrit, but we did not anticipate how strict other systems are in practice. (I did not notice this issue earlier because the Piper check does not trigger when sending a CL for Google-wide testing, only when mailing a CL for review.) It stands to reason that if our revision control and review systems do not like string literals with non-UTF8 content, other systems probably behave similarly. Hence, let’s revert that part of the change. The key part of the change was to switch the type of the embedded descriptor bytes from mutable []byte to immutable string. I verified that the string literal remains in .rodata: % (cd internal/reflection_test && \ go test -c && \ objdump -s -j .rodata reflection_test.test | grep '0a46696e') 8e9fd0 0a46696e 7465726e 616c2f74 65737470 .Finternal/testp The bytes printed above only occur once and match the bytes from file_internal_testprotos_testeditions_testeditions_hybrid_test_hybrid_proto_rawDesc Change-Id: I8e1bfe53a5bbf65abe7861a749ace37b215a8e28 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/642857 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Nicolas Hillegeer <[email protected]>
- Loading branch information
1 parent
0c3cc2f
commit aee8a9c
Showing
145 changed files
with
26,552 additions
and
196 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.