mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-01 11:58:21 +00:00
c1c17aa013
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> |
||
---|---|---|
.. | ||
testdata/go_package | ||
names_test.go | ||
names.go | ||
protogen_test.go | ||
protogen.go |