Added support for proto3 field presence (#3752)
This commit is contained in:

committed by
GitHub

parent
a1ace9105a
commit
cee815dbe3
@ -34,6 +34,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"google.golang.org/protobuf/compiler/protogen"
|
"google.golang.org/protobuf/compiler/protogen"
|
||||||
|
"google.golang.org/protobuf/types/pluginpb"
|
||||||
)
|
)
|
||||||
|
|
||||||
var requireUnimplemented *bool
|
var requireUnimplemented *bool
|
||||||
@ -45,6 +46,7 @@ func main() {
|
|||||||
protogen.Options{
|
protogen.Options{
|
||||||
ParamFunc: flags.Set,
|
ParamFunc: flags.Set,
|
||||||
}.Run(func(gen *protogen.Plugin) error {
|
}.Run(func(gen *protogen.Plugin) error {
|
||||||
|
gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
|
||||||
for _, f := range gen.Files {
|
for _, f := range gen.Files {
|
||||||
if !f.Generate {
|
if !f.Generate {
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user