protobuf-go/internal
Joe Tsai 4069211bcd protogen: use full path for generated file variable name
Use the full path (including the extension) for the generation of
the per-file variable name. Several reasons for this:

* The current logic is buggy in the case where pathType == pathTypeImport
since the prefix variable will be mangled with the Go import path.

* The extension is technically part of the path.
Thus, "path/to/foo.proto" and "path/to/foo.protodevel" are two
distinctly different imports.

* Style-wise, it subjectively looks better. Rather than being a mixture
of camelCase and snake_case, it is all snake_case for the common case:
	before: ProtoFile_google_protobuf_any
	after:  File_google_protobuf_any_proto

* Since the extension is almost always ".proto", this results in a
suffix of "_proto", which provides an additional layer of protection
against possible name conflicts. The previous approach could possibly
have a conflict between "Foo.proto" and a message named ProtoFile
with a sub-message called Foo.

Also, use the per-file variable name for the raw descriptor variables
instead of the hashed version.

Change-Id: Ic91e326b7593e5985cee6ececc60539c27fe32fe
Reviewed-on: https://go-review.googlesource.com/c/164379
Reviewed-by: Damien Neil <dneil@google.com>
2019-03-01 00:13:31 +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: fix New in eliding prefix 2019-02-27 22:36:14 +00:00
fileinit protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
flags
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
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
testprotos protogen: use full path for generated file variable name 2019-03-01 00:13:31 +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