frostfs-sdk-go/api/util/protogen/main.go

28 lines
535 B
Go
Raw Normal View History

package main
import (
"flag"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/protogen/internalgengo"
"google.golang.org/protobuf/compiler/protogen"
)
func main() {
var flags flag.FlagSet
genFuzz := flags.Bool("fuzz", false, "generate fuzz tests")
protogen.Options{
ParamFunc: flags.Set,
}.Run(func(gen *protogen.Plugin) error {
for _, f := range gen.Files {
if f.Generate {
internalgengo.GenerateFile(gen, f)
if *genFuzz {
internalgengo.GenerateFuzzTests(gen, f)
}
}
}
return nil
})
}