fix gf gen service remove all comments. (#2845)

This commit is contained in:
oldme
2023-08-07 20:42:10 +08:00
committed by GitHub
parent 7798e96190
commit b593c00d97

View File

@ -194,7 +194,7 @@ func (c CGenService) Service(ctx context.Context, in CGenServiceInput) (out *CGe
return nil, err
}
// remove all comments.
fileContent, err = gregex.ReplaceString(`/[/|\*](.*)`, "", fileContent)
fileContent, err = gregex.ReplaceString(`//(.*)|(?s)/\*(.*?)\*/`, "", fileContent)
if err != nil {
return nil, err
}