Skip to content

Commit

Permalink
persister: add optional support (#85)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitriy Kunitskiy <[email protected]>
  • Loading branch information
glerchundi and Dmitriy Kunitskiy authored May 4, 2021
1 parent faa4d12 commit 8ed22a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/golang/protobuf/proto"
plugin_go "github.com/golang/protobuf/protoc-gen-go/plugin"
"github.com/spf13/afero"
"google.golang.org/protobuf/types/pluginpb"
)

type persister interface {
Expand All @@ -33,6 +34,9 @@ func (p *stdPersister) AddPostProcessor(proc ...PostProcessor) { p.procs = appen
func (p *stdPersister) Persist(arts ...Artifact) *plugin_go.CodeGeneratorResponse {
resp := new(plugin_go.CodeGeneratorResponse)

supportedFeatures := uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
resp.SupportedFeatures = &supportedFeatures

for _, a := range arts {
switch a := a.(type) {
case GeneratorFile:
Expand Down

0 comments on commit 8ed22a1

Please sign in to comment.