protobuf-go/protogen
Joe Tsai 2c6f09887d protogen: simplify and fix naming derivation logic
We want to codify the naming logic to be understandable in a specification.
Clean up the camelCase function to be a little more readable.

Cleanup and fix the cleanGoName function when mustExport is true.
It is okay to change this behavior since this is new logic in v2 that has not
yet been exposed to the universe.

In the mustExport code-path, we do not need to check for conflicts with keywords
since Go keywords are never uppercase, so the uppercasing of the first letter
is sufficient to break a conflict. Also, we fix the logic for uppercasing
the first character since not every lowercase character has an uppercase form.

Change-Id: If14422d773bb89ed7038d874135e3dcd12683101
Reviewed-on: https://go-review.googlesource.com/c/154180
Reviewed-by: Damien Neil <dneil@google.com>
2018-12-14 18:30:52 +00:00
..
testdata/go_package protogen, cmd/protoc-gen-go: initial commit 2018-08-22 17:08:04 +00:00
names_test.go protogen: simplify and fix naming derivation logic 2018-12-14 18:30:52 +00:00
names.go protogen: simplify and fix naming derivation logic 2018-12-14 18:30:52 +00:00
protogen_test.go cmd/protoc-gen-go: generate descriptor and plugin with reflection 2018-12-06 17:47:27 +00:00
protogen.go protogen: annotate interface methods 2018-12-12 19:34:33 +00:00