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