protobuf-go/protogen
Joe Tsai c1c17aa013 protogen: add GoImportPath.Ident helper
The GoImportPath.Ident helper creates a GoIdent using the receiver
as the GoImportPath in the GoIdent. This helper helps with the construction
of qualified identifiers.

Example usage:
	const protoPackage = protogen.GoImportPath("github.com/golang/protobuf/proto")
	protoPackage.Ident("ExtensionRange") // produces "proto.ExtensionRange"

The advantage of this helper is that usage of it looks similar to how
the identifier will eventually be rendered.

This is significantly more readable than the current approach:
	protogen.GoIdent{
		GoImportPath: protoPackage,
		GoName: "ExtensionRange",
	}

Change-Id: If7ecd7e60fad12bc491eee0dcb05f8fdebc9c94e
Reviewed-on: https://go-review.googlesource.com/c/150058
Reviewed-by: Damien Neil <dneil@google.com>
2018-11-16 19:34:14 +00:00
..
testdata/go_package protogen, cmd/protoc-gen-go: initial commit 2018-08-22 17:08:04 +00:00
names_test.go protogen: camel-case "Foo.bar" as "FooBar" instead of "Foo_Bar". 2018-10-16 16:18:01 +00:00
names.go protogen: add GoImportPath.Ident helper 2018-11-16 19:34:14 +00:00
protogen_test.go protogen: generate .meta file with code annotations 2018-10-16 17:22:41 +00:00
protogen.go protogen: add GoImportPath.Ident helper 2018-11-16 19:34:14 +00:00