protobuf-go/cmd/protoc-gen-go/testdata/imports
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
..
fmt protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_a_1 protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_a_2 protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_b_1 protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_import_a1m1.pb.go protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_import_a1m1.proto protoc-gen-go: generate imports consistent with previous protoc-gen-go 2018-09-14 22:40:55 +00:00
test_import_a1m2.pb.go protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_import_a1m2.proto protoc-gen-go: generate imports consistent with previous protoc-gen-go 2018-09-14 22:40:55 +00:00
test_import_all.pb.go protogen: use full path for generated file variable name 2019-03-01 00:13:31 +00:00
test_import_all.proto cmd/protoc-gen-go: generate blank imports for unused proto dependencies 2018-09-19 21:12:48 +00:00