...
1
16
17 package main
18
19 import (
20 _ "github.com/containerd/ttrpc/plugin"
21 "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
22 "github.com/gogo/protobuf/vanity"
23 "github.com/gogo/protobuf/vanity/command"
24 )
25
26 func main() {
27 req := command.Read()
28 files := req.GetProtoFile()
29 files = vanity.FilterFiles(files, vanity.NotGoogleProtobufDescriptorProto)
30 for _, opt := range []func(*descriptor.FileDescriptorProto){
31 vanity.TurnOffGoGettersAll,
32 vanity.TurnOffGoStringerAll,
33 vanity.TurnOnMarshalerAll,
34 vanity.TurnOnStringerAll,
35 vanity.TurnOnUnmarshalerAll,
36 vanity.TurnOnSizerAll,
37 } {
38 vanity.ForEachFile(files, opt)
39 }
40
41 resp := command.Generate(req)
42 command.Write(resp)
43 }
44
View as plain text