protoc-gen-go patch utility
(go.field).type = "SomeType"
to override the field type in generated Go code. The specified type must be castable to the field’s native type, and defined in the target package. Scalar and repeated fields are supported, e.g. type Things []Thing
. This feature is similar to the casttype
feature in gogoprotobuf.optional
support for proto3.(go.field).embed = true
to embed a message field in the generated Go struct. The resulting field will be a pointer to and sharing a name with the generated Go struct.go.lint
option. When specified, protoc-gen-go-patch
will attempt to fix generated Go names to their idiomatic equivalents, e.g. Id
→ ID
, Url
→ URL
, etc. It will also eliminate stutter from enum values, e.g. Foo_FOO_UNKNOWN
→ FooUnknown
. Thanks to @Green7 for the initial implementation in #22.(go.lint).initialisms
option to specify your own initialisms for go.lint
. Example: (go.lint).initialisms = 'RGB'; // Lints RgbColor to RGBColor
. You may specify as many custom initialisms as needed. They will only affect identifiers declared in that file.