|
|
|
@ -82,11 +82,19 @@ func genErrorsReason(gen *protogen.Plugin, file *protogen.File, g *protogen.Gene |
|
|
|
|
if enumCode == 0 { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
comment := v.Comments.Leading.String() |
|
|
|
|
if comment == "" { |
|
|
|
|
comment = v.Comments.Trailing.String() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := &errorInfo{ |
|
|
|
|
Name: string(enum.Desc.Name()), |
|
|
|
|
Value: string(v.Desc.Name()), |
|
|
|
|
CamelValue: case2Camel(string(v.Desc.Name())), |
|
|
|
|
HTTPCode: enumCode, |
|
|
|
|
Comment: comment, |
|
|
|
|
HasComment: len(comment) > 0, |
|
|
|
|
} |
|
|
|
|
ew.Errors = append(ew.Errors, err) |
|
|
|
|
} |
|
|
|
@ -94,6 +102,7 @@ func genErrorsReason(gen *protogen.Plugin, file *protogen.File, g *protogen.Gene |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
g.P(ew.execute()) |
|
|
|
|
|
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|