protobuf-go/internal
Damien Neil 71c6603a26 protogen: use full filename in per-file vars
For a file "foo/bar.proto", put the FileDescriptor in "ProtoFile_foo_bar"
rather than "Bar_fileDescriptor".

Avoid name clashes when a package contains "a/foo.proto" and "b/foo.proto".

Don't camelcase the filename: These vars weren't fully camelcased to begin
with, and leaving the filename relatively unchanged is clearer and more
predictable.

Move "ProtoFile" from the end of the var name to the start, so that vars
will sort better in packages with multiple descriptors.

These changes do add a chance of name collision when the input filename
begins with an uppercase letter: Foo.proto becomes "ProtoFile_Foo", which
could be the result of camelcasing "proto_file.foo". The readability
benefits seem worth it.

Change-Id: If27d3a0d7b5bf3535aa1607a8579eb057c74d2dc
Reviewed-on: https://go-review.googlesource.com/c/163199
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2019-02-21 22:37:58 +00:00
..
cmd internal/fileinit: generate reflect data structures from raw descriptors 2019-01-30 01:33:46 +00:00
detrand internal/detrand: support disabling detrand 2018-11-29 07:49:45 +00:00
encoding internal/encoding/pack: don't depend on exact math.NaN bits 2019-02-12 21:38:35 +00:00
errors internal/errors: initial commit 2018-08-02 18:28:47 +00:00
fileinit protogen: use full filename in per-file vars 2019-02-21 22:37:58 +00:00
flags internal/flags: add package to control specialized functionality 2018-08-03 22:59:53 +00:00
impl internal/impl: drop MessageType.(Unk|K)nownFieldsOf 2019-01-30 01:34:45 +00:00
legacy internal/fileinit: generate reflect data structures from raw descriptors 2019-01-30 01:33:46 +00:00
pragma internal/pragma: package to statically enforce certain properties 2018-08-06 21:47:01 +00:00
protogen/goldentest protogen: annotate interface methods 2018-12-12 19:34:33 +00:00
scalar internal/scalar: add scalar package for primitive wrappers 2018-11-28 07:06:11 +00:00
set internal/set: add set package for set data structures 2018-08-09 21:46:35 +00:00
testprotos protogen: use full filename in per-file vars 2019-02-21 22:37:58 +00:00
typefmt reflect/protoreflect: add HasJSONName, ReservedRanges, and ReservedNames 2018-12-07 20:10:15 +00:00
value reflect: switch MessageType.New to return Message 2019-01-09 20:29:29 +00:00