We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c3e748 commit add29aaCopy full SHA for add29aa
pbex/protoc-gen-go-pbex/main.go
@@ -22,6 +22,7 @@ func main() {
22
//pre check
23
needfile := make(map[string]bool)
24
for _, f := range gen.Files {
25
+ needfile[f.Desc.Path()] = false
26
if !f.Generate {
27
continue
28
}
@@ -35,8 +36,10 @@ func main() {
35
36
if pbex.OneOfHasPBEX(m) {
37
panic("oneof fields should not contain pbex")
38
39
+ if pbex.NeedValidate(m) {
40
+ needfile[f.Desc.Path()] = true
41
+ }
42
- needfile[f.Desc.Path()] = len(f.Messages) > 0
43
//delete old file
44
oldfile := f.GeneratedFilenamePrefix + "_pbex.pb.go"
45
if e := os.RemoveAll(oldfile); e != nil {
0 commit comments