Skip to content

Commit add29aa

Browse files
committed
update
1 parent 3c3e748 commit add29aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pbex/protoc-gen-go-pbex/main.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func main() {
2222
//pre check
2323
needfile := make(map[string]bool)
2424
for _, f := range gen.Files {
25+
needfile[f.Desc.Path()] = false
2526
if !f.Generate {
2627
continue
2728
}
@@ -35,8 +36,10 @@ func main() {
3536
if pbex.OneOfHasPBEX(m) {
3637
panic("oneof fields should not contain pbex")
3738
}
39+
if pbex.NeedValidate(m) {
40+
needfile[f.Desc.Path()] = true
41+
}
3842
}
39-
needfile[f.Desc.Path()] = len(f.Messages) > 0
4043
//delete old file
4144
oldfile := f.GeneratedFilenamePrefix + "_pbex.pb.go"
4245
if e := os.RemoveAll(oldfile); e != nil {

0 commit comments

Comments
 (0)