diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8b0d76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Develop tools +/.vscode/ +/.idea/ + +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Folders +_obj +_test +_build + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# vim temp files +*~ +*.swp +*.swo +/protoc-gen-micro + diff --git a/main.go b/main.go index 5ebc2ae..c6c0b97 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "strings" "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/pluginpb" ) var ( @@ -36,6 +37,7 @@ func (g *Generator) Generate(plugin *protogen.Plugin) error { g.standalone = *flagStandalone g.debug = *flagDebug g.components = *flagComponents + plugin.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) // Protoc passes a slice of File structs for us to process for _, component := range strings.Split(g.components, "|") {