github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/swarmkit/cmd/protoc-gen-gogoswarm/main.go (about) 1 package main 2 3 import ( 4 _ "github.com/docker/swarmkit/protobuf/plugin/authenticatedwrapper" 5 _ "github.com/docker/swarmkit/protobuf/plugin/deepcopy" 6 _ "github.com/docker/swarmkit/protobuf/plugin/raftproxy" 7 _ "github.com/docker/swarmkit/protobuf/plugin/storeobject" 8 "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" 9 "github.com/gogo/protobuf/vanity" 10 "github.com/gogo/protobuf/vanity/command" 11 ) 12 13 func main() { 14 req := command.Read() 15 files := req.GetProtoFile() 16 files = vanity.FilterFiles(files, vanity.NotGoogleProtobufDescriptorProto) 17 18 for _, opt := range []func(*descriptor.FileDescriptorProto){ 19 vanity.TurnOffGoGettersAll, 20 vanity.TurnOffGoStringerAll, 21 vanity.TurnOnMarshalerAll, 22 vanity.TurnOnStringerAll, 23 vanity.TurnOnUnmarshalerAll, 24 vanity.TurnOnSizerAll, 25 vanity.TurnOffGoUnrecognizedAll, 26 vanity.TurnOffGoUnkeyedAll, 27 vanity.TurnOffGoUnrecognizedAll, 28 vanity.TurnOffGoSizecacheAll, 29 CustomNameID, 30 } { 31 vanity.ForEachFile(files, opt) 32 } 33 34 resp := command.Generate(req) 35 command.Write(resp) 36 }