1 Star 0 Fork 0

东海苍月 / go-protobuf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 637 Bytes
一键复制 编辑 原始数据 按行查看 历史
东海苍月 提交于 2022-01-18 22:43 . feat: add errors cli util #0000
package main
import (
"flag"
"fmt"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb"
)
var showVersion = flag.Bool("version", false, "print the version and exit")
func main() {
flag.Parse()
if *showVersion {
fmt.Printf("protoc-gen-go-errors %v\n", release)
return
}
var flags flag.FlagSet
protogen.Options{
ParamFunc: flags.Set,
}.Run(func(gen *protogen.Plugin) error {
gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
for _, f := range gen.Files {
if !f.Generate {
continue
}
generateFile(gen, f)
}
return nil
})
}
Go
1
https://gitee.com/dhcy/go-protobuf.git
git@gitee.com:dhcy/go-protobuf.git
dhcy
go-protobuf
go-protobuf
df21623b900f

搜索帮助