github.com/cosmos/cosmos-proto@v1.0.0-beta.3/features/protoc/feature.go (about) 1 package protoc 2 3 import ( 4 "github.com/cosmos/cosmos-proto/generator" 5 "google.golang.org/protobuf/compiler/protogen" 6 ) 7 8 func init() { 9 generator.RegisterFeature("protoc", func(gen *generator.GeneratedFile, plugin *protogen.Plugin) generator.FeatureGenerator { 10 return protocGenGoFeature{ 11 Plugin: plugin, 12 GeneratedFile: gen, 13 once: false, 14 } 15 }) 16 } 17 18 type protocGenGoFeature struct { 19 *protogen.Plugin 20 *generator.GeneratedFile 21 once bool 22 } 23 24 func (pg protocGenGoFeature) GenerateFile(file *protogen.File, plugin *protogen.Plugin) bool { 25 GenerateFile(plugin, file, pg.GeneratedFile) 26 return pg.once 27 } 28 29 func (pg protocGenGoFeature) GenerateHelpers() {} //noop